From 0d16e365061b4ee204e813058b20ab60411f21c0 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Sat, 26 Sep 2020 11:58:09 +0900 Subject: [PATCH] Remove restriction that SpanContext must be a final class, specify creation. (#969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove restriction that SpanContext must be a final class * Methods for SpanContext. * Lint * No bookmark? * Root span needs sampling * Non-root needs sampling too * API-only * Update specification/trace/api.md Co-authored-by: Christian Neumüller * Update specification/trace/api.md Co-authored-by: Christian Neumüller * Note * less is more * Update specification/trace/api.md Co-authored-by: Christian Neumüller Co-authored-by: Christian Neumüller --- specification/trace/api.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/specification/trace/api.md b/specification/trace/api.md index 4312dbc761d..2aec5d92bc6 100644 --- a/specification/trace/api.md +++ b/specification/trace/api.md @@ -170,7 +170,6 @@ These functions MUST delegate to the `Tracing Context Utilities`. A `SpanContext` represents the portion of a `Span` which must be serialized and propagated along side of a distributed context. `SpanContext`s are immutable. -`SpanContext` MUST be a final (sealed) class. The OpenTelemetry `SpanContext` representation conforms to the [W3C TraceContext specification](https://www.w3.org/TR/trace-context/). It contains two @@ -192,6 +191,10 @@ of key-value pairs. TraceState allows multiple tracing systems to participate in the same trace. It is fully described in the [W3C Trace Context specification](https://www.w3.org/TR/trace-context/#tracestate-header). +The API MUST implement methods to create a `SpanContext`. These methods SHOULD be the only way to +create a `SpanContext`. This functionality MUST be fully implemented in the API, and SHOULD NOT be +overridable. + ### Retrieving the TraceId and SpanId The API MUST allow retrieving the `TraceId` and `SpanId` in the following forms: