Skip to content

Commit

Permalink
chore: improve span name
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Aug 26, 2024
1 parent 591d8d7 commit 74f9375
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions example/websocket/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
defer uptrace.Shutdown(ctx)

// Start a root span for a websocket connection.
ctx, span := tracer.Start(ctx, "websocket", trace.WithSpanKind(trace.SpanKindServer))
ctx, span := tracer.Start(ctx, "websocket-conn", trace.WithSpanKind(trace.SpanKindServer))
defer span.End()

fmt.Printf("websocket connection: %s\n", uptrace.TraceURL(span))
Expand All @@ -42,7 +42,8 @@ func main() {
func handleWebsocketRequest(ctx context.Context) {
// Create another span so we can end it separately from the root span.
// The root span can stay open for hours.
ctx, span := tracer.Start(ctx, "websocket-request", trace.WithSpanKind(trace.SpanKindServer))
ctx, span := tracer.Start(ctx, "websocket-conn-new-request",
trace.WithSpanKind(trace.SpanKindServer))
defer span.End()

// Save parent context.
Expand Down

0 comments on commit 74f9375

Please sign in to comment.