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

OpenTracing Shim: Allow invalid but sampled SpanContext to be returned. #3471

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ release.

### Compatibility

- OpenTracing Shim: Allow invalid but sampled SpanContext to be returned.
([#3471](https://github.com/open-telemetry/opentelemetry-specification/pull/3471))

### SDK Configuration

### Common
Expand Down
18 changes: 14 additions & 4 deletions specification/compatibility/opentracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,18 @@ registered or the global OpenTelemetry `Propagator`s, as configured at construct
- `TextMap` and `HttpHeaders` formats MUST use their explicitly specified `TextMapPropagator`,
if any, or else use the global `TextMapPropagator`.

If the extracted `SpanContext` is invalid AND the extracted `Baggage` is empty, this operation
MUST return a null value, and otherwise it MUST return a `SpanContext` Shim instance with
the extracted values.
The operation MUST return a `SpanContext` Shim instance with the extracted values if any of these conditions are met:

* `SpanContext` is valid.
* `SpanContext` is sampled.
* `SpanContext` contains non-empty extracted `Baggage`.

Otherwise, the operation MUST return null or empty value.

```java
if (!extractedSpanContext.isValid() && extractedBaggage.isEmpty()) {
if (!extractedSpanContext.isValid()
&& !extractedSpanContext.isSampled()
&& extractedBaggage.isEmpty()) {
return null;
}

Expand All @@ -210,6 +216,10 @@ Errors MAY be raised if either the `Format` is not recognized
or no value could be extracted, depending on the specific OpenTracing Language API
(e.g. Go and Python do, but Java may not).

Note: Invalid but sampled `SpanContext` instances are returned as a way to support
`jaeger-debug-id` [headers](https://github.com/jaegertracing/jaeger-client-java#via-http-headers),
which are used to force propagation of debug information.

## Close

OPTIONAL operation. If this operation is implemented for a specific OpenTracing language,
Expand Down