-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[OpenTracing bridge] Support setting span kind tag after the creation of span #3997
base: main
Are you sure you want to change the base?
Conversation
384910f
to
202cbe9
Compare
202cbe9
to
b8e066b
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3997 +/- ##
=====================================
Coverage 82.2% 82.2%
=====================================
Files 175 175
Lines 13058 12987 -71
=====================================
- Hits 10738 10681 -57
+ Misses 2099 2084 -15
- Partials 221 222 +1
|
b8e066b
to
27fe4c7
Compare
… of a span Signed-off-by: Chen Xu <[email protected]>
27fe4c7
to
ad34f57
Compare
// only add span kind tag when otel span kind is unset or bridge default (internal) | ||
if span, ok := s.otelSpan.(readSpanKindSpan); ok { | ||
if span.SpanKind() == trace.SpanKindUnspecified || span.SpanKind() == trace.SpanKindInternal { | ||
s.otelSpan.SetAttributes(otTagToOTelAttr(key, value)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will cause the span.kind
to be duplicated at the exporter level. This will set it in the attributes, but the recordingSpan.spanKind
will also be set to the default internal
- both of these seem to get sent via the exporter. I've tested this with go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc
sending to Jaeger collector.
Resolves #3953
A few middleware frameworks (e.g https://github.com/yarpc/yarpc-go/blob/600cb49cc6331d8d15f65c058615a7649447efa7/api/transport/propagation.go#L67) that our company is using still set the OT span kind tag after a span is created.
Missing the span kind tags will impact a few functionalities in Jaeger (one of the OpenTracing implementations) that reply on the span kind tags.
Setting span kind tag in the bridge after a span is created cannot really set the SpanKind of OTel span, but adds the attribute instead which still helps in our case a lot.