Skip to content

Commit 74f9375

Browse files
committed
chore: improve span name
1 parent 591d8d7 commit 74f9375

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

example/websocket/main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func main() {
2929
defer uptrace.Shutdown(ctx)
3030

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

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

4849
// Save parent context.

0 commit comments

Comments
 (0)