From ccd5f5241e161515a0741f2dea04c0d05c4d1a47 Mon Sep 17 00:00:00 2001 From: Nathaniel Ruiz Nowell Date: Fri, 20 Nov 2020 10:24:20 -0800 Subject: [PATCH] Add interface for IDs Generator mechanism. Co-authored-by: Anuraag Agrawal --- CHANGELOG.md | 7 +++++-- specification/trace/sdk.md | 11 +++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 811cb3304a3..5bfaf0192d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ release. ## Unreleased +- 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) New: @@ -73,8 +76,8 @@ New: ([#1136](https://github.com/open-telemetry/opentelemetry-specification/pull/1136/)) - Add guidelines for OpenMetrics interoperability ([#1154](https://github.com/open-telemetry/opentelemetry-specification/pull/1154)) -- Add requirement that the SDK allow custom generation of Trace IDs and Span IDs - ([#1006](https://github.com/open-telemetry/opentelemetry-specification/pull/1006)) +- Add OTEL_TRACE_SAMPLER_ARG env variable definition + ([#1202](https://github.com/open-telemetry/opentelemetry-specification/pull/1202)) Updates: diff --git a/specification/trace/sdk.md b/specification/trace/sdk.md index 0ff77c452e3..19451620bb3 100644 --- a/specification/trace/sdk.md +++ b/specification/trace/sdk.md @@ -228,6 +228,17 @@ both the `TraceId` and the `SpanId`. The SDK SHOULD by default randomly generate the bytes 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.