From 45f8d8c86a18c5130706c414ce990bfd8f364324 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Thu, 14 Sep 2023 11:27:07 +0300 Subject: [PATCH] chore: add span_id to the trace url --- uptrace/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uptrace/client.go b/uptrace/client.go index 329aa4e5..5d33a01a 100644 --- a/uptrace/client.go +++ b/uptrace/client.go @@ -61,7 +61,9 @@ func (c *client) ForceFlush(ctx context.Context) (lastErr error) { // TraceURL returns the trace URL for the span. func (c *client) TraceURL(span trace.Span) string { - return fmt.Sprintf("%s/traces/%s", c.dsn.AppAddr(), span.SpanContext().TraceID()) + sctx := span.SpanContext() + return fmt.Sprintf("%s/traces/%s?span_id=%s", + c.dsn.AppAddr(), sctx.TraceID(), sctx.SpanID().String()) } // ReportError reports an error as a span event creating a dummy span if necessary.