Skip to content

Commit

Permalink
Require the SDK to provide custom ID generation
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanielRN committed Dec 15, 2020
1 parent 75d79b7 commit 43652ff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Updates:
- Resource's service.name MUST have a default value, service.instance.id is not
required.
([#1269](https://github.com/open-telemetry/opentelemetry-specification/pull/1269))
- Add requirement that the SDK allow custom generation of Trace IDs and Span IDs
([#1006](https://github.com/open-telemetry/opentelemetry-specification/pull/1006))

## v0.7.0 (11-18-2020)

Expand Down
1 change: 1 addition & 0 deletions spec-compliance-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ status of the feature is not known.
|Allow samplers to modify tracestate | | + | | + | | + | | + | | | + |
|ShouldSample gets full parent Context | | + | + | + | | + | | | | | + |
|[New Span ID created also for non-recording Spans](specification/trace/sdk.md#sdk-span-creation) | | | | + | | | | | | | + |
|SDK Trace & Span ID generation is customizable| + | + | + | + | | | | | | + | |

## Baggage

Expand Down
17 changes: 17 additions & 0 deletions specification/trace/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,23 @@ Note: Implementation-wise, this could mean that `Tracer` instances have a
reference to their `TracerProvider` and access configuration only via this
reference.

The SDK MUST by default randomly generate the bytes for both the `TraceId` and
the `SpanId`.

The SDK MUST provide a mechanism for customizing the way IDs are generated for
both the `TraceId` and the `SpanId`.

The SDK MAY provide this functionality by allowing custom implementations of
an interface like `IdsGenerator` below, which provides extension points for two
methods, one to generate a `SpanID` and one to generate a `TraceId`.

```
IdsGenerator {
String generateSpanId()
String generateTraceId()
}
```

### Shutdown

This method provides a way for provider to do any cleanup required.
Expand Down

0 comments on commit 43652ff

Please sign in to comment.