1
0
Fork 0

Follow OTel semantic conventions for root span naming

This commit is contained in:
Alex Waring 2025-08-22 15:45:04 +01:00 committed by GitHub
parent fd8a64ca95
commit fcae39bf13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 59 additions and 22 deletions

View file

@ -30,7 +30,7 @@ func TestNewRouter(t *testing.T) {
routerRule: "Path(`/`)",
expected: []expected{
{
name: "EntryPoint",
name: "GET",
attributes: []attribute.KeyValue{
attribute.String("span.kind", "server"),
},
@ -63,7 +63,7 @@ func TestNewRouter(t *testing.T) {
req.Header.Set("User-Agent", "router-test")
tracer := &mockTracer{}
tracingCtx, entryPointSpan := tracer.Start(req.Context(), "EntryPoint", trace.WithSpanKind(trace.SpanKindServer))
tracingCtx, entryPointSpan := tracer.Start(req.Context(), http.MethodGet, trace.WithSpanKind(trace.SpanKindServer))
defer entryPointSpan.End()
req = req.WithContext(tracingCtx)