From a178592098a2bc07fcb7749eaf148debf02a5e63 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Wed, 29 Aug 2018 16:09:37 -0700 Subject: Fix trace ID generation and improve trace naming scheme --- src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/scala/xyz/driver/core/reporting/GoogleReporter.scala') 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) -- cgit v1.2.3