Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracing: span kind not set #5801

Closed
Tracked by #6351
wkloucek opened this issue Mar 10, 2023 · 0 comments · Fixed by #6471
Closed
Tracked by #6351

tracing: span kind not set #5801

wkloucek opened this issue Mar 10, 2023 · 0 comments · Fixed by #6471
Assignees
Labels
Category:Enhancement Add new functionality

Comments

@wkloucek
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Our spans have no kind set. Read more about span kinds: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#spankind

Because of this missing span kind, some tools might not work properly, eg. Jaeger SPM (https://www.jaegertracing.io/docs/1.42/spm/#serviceoperation-missing-in-monitor-tab)

Describe the solution you'd like

Have a kind set on our spans.

Additional context

Example how to set it:

diff --git a/services/proxy/pkg/proxy/proxy.go b/services/proxy/pkg/proxy/proxy.go
index 4e773ca1f..aeaa4c9c6 100644
--- a/services/proxy/pkg/proxy/proxy.go
+++ b/services/proxy/pkg/proxy/proxy.go
@@ -90,7 +90,12 @@ func (p *MultiHostReverseProxy) ServeHTTP(w http.ResponseWriter, r *http.Request
        )
 
        tracer := proxytracing.TraceProvider.Tracer("proxy")
-       ctx, span = tracer.Start(ctx, fmt.Sprintf("%s %v", r.Method, r.URL.Path))
+
+       spanOpts := []trace.SpanStartOption{
+               trace.WithSpanKind(trace.SpanKindServer),
+       }
+
+       ctx, span = tracer.Start(ctx, fmt.Sprintf("%s %v", r.Method, r.URL.Path), spanOpts...)
        defer span.End()
 
        span.SetAttributes(
@wkloucek wkloucek added the Category:Enhancement Add new functionality label Mar 10, 2023
@Excds Excds self-assigned this Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category:Enhancement Add new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants