Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tracing: finish OTEL bridge span only once (#10095)
* tracing: finish OTEL bridge span only once #### Problem The OTEL spec allows to close the span multiple times and that `End` should be idempotent. I think the jaeger implementation doesn't have the same guarantees, so we have to handle this in out bridge implementation. Currently, we allow to call `Finish` multiple times and we end up reporting the span multiple times: once for exhausting the HTTP request body with `io.EOF` and once for `Close()`. For more details see https://github.com/open-telemetry/opentelemetry-go-contrib /pull/6391 #### The OTEL spec https://github.com/open-telemetry/opentelemetry-specification/blob/50027a1036746dce293ee0a8592639f131fc1fb8/specification/trace/api.md#end > Implementations SHOULD ignore all subsequent calls to End and any other Span methods, i.e. the Span becomes non-recording by being ended (there might be exceptions when Tracer is streaming events and has no mutable state associated with the Span). Signed-off-by: Dimitar Dimitrov <[email protected]> * Apply suggestions from code review Co-authored-by: Arve Knudsen <[email protected]> --------- Signed-off-by: Dimitar Dimitrov <[email protected]> Co-authored-by: Arve Knudsen <[email protected]>
- Loading branch information