aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala
diff options
context:
space:
mode:
authorJakob Odersky <jakob@driver.xyz>2018-08-29 16:09:37 -0700
committerJakob Odersky <jakob@driver.xyz>2018-09-12 14:17:39 -0700
commita178592098a2bc07fcb7749eaf148debf02a5e63 (patch)
tree4c64614dd13b99b074bd56fa355d3d49a90e4feb /src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala
parent5ec270aa98b806f32338fa25357abdf45dd0625b (diff)
downloaddriver-core-a178592098a2bc07fcb7749eaf148debf02a5e63.tar.gz
driver-core-a178592098a2bc07fcb7749eaf148debf02a5e63.tar.bz2
driver-core-a178592098a2bc07fcb7749eaf148debf02a5e63.zip
Fix trace ID generation and improve trace naming scheme
Diffstat (limited to 'src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala')
-rw-r--r--src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala b/src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala
index 40cb1e5..2f889f5 100644
--- a/src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala
+++ b/src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala
@@ -111,7 +111,7 @@ class GoogleReporter(
parentSpanId: Option[String],
displayName: String,
attributes: Map[String, String]) = Span(
- s"project/${credentials.getProjectId}/traces/$traceId/spans/$spanId",
+ s"projects/${credentials.getProjectId}/traces/$traceId/spans/$spanId",
spanId,
parentSpanId,
TruncatableString(displayName),
@@ -125,7 +125,7 @@ class GoogleReporter(
tags: Map[String, String],
parent: Option[(SpanContext, CausalRelation)])(operation: SpanContext => A): A = {
val child = parent match {
- case Some((p, _)) => SpanContext(p.traceId, f"${Random.nextLong()}%02x")
+ case Some((p, _)) => SpanContext(p.traceId, f"${Random.nextLong()}%016x")
case None => SpanContext.fresh()
}
val span = startSpan(child.traceId, child.spanId, parent.map(_._1.spanId), operationName, tags)
@@ -140,7 +140,7 @@ class GoogleReporter(
tags: Map[String, String],
parent: Option[(SpanContext, CausalRelation)])(operation: SpanContext => Future[A]): Future[A] = {
val child = parent match {
- case Some((p, _)) => SpanContext(p.traceId, f"${Random.nextLong()}%02x")
+ case Some((p, _)) => SpanContext(p.traceId, f"${Random.nextLong()}%016x")
case None => SpanContext.fresh()
}
val span = startSpan(child.traceId, child.spanId, parent.map(_._1.spanId), operationName, tags)