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

Add W3C-specified trace flags to v1 Span proto #503

Merged
merged 13 commits into from
Sep 14, 2023
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v1.0.0...main).

### Added

* Add a field for W3C-specified Trace Context flags to the `Span` and `Link`.
[#503](https://github.com/open-telemetry/opentelemetry-proto/pull/503)

## 1.0.0 - 2023-07-03

Full list of differences found in [this compare](https://github.com/open-telemetry/opentelemetry-proto/compare/v0.20.0...v1.0.0).
Expand Down
14 changes: 13 additions & 1 deletion opentelemetry/proto/trace/v1/trace.proto
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ message ScopeSpans {

// A Span represents a single operation performed by a single component of the system.
//
// The next available field id is 17.
// The next available field id is 18.
jmacd marked this conversation as resolved.
Show resolved Hide resolved
message Span {
// A unique identifier for a trace. All spans from the same trace share
// the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR
Expand All @@ -103,6 +103,12 @@ message Span {
// field must be empty. The ID is an 8-byte array.
bytes parent_span_id = 4;

// Flags from the W3C traceparent, if provided.
// There are two flags defined in the W3C Trace Context Level 2 spec:
jmacd marked this conversation as resolved.
Show resolved Hide resolved
// - sampled = 0x1
// - random = 0x2
uint32 trace_flags = 17;
jmacd marked this conversation as resolved.
Show resolved Hide resolved

// A description of the span's operation.
//
// For example, the name can be a qualified method name or a file name
Expand Down Expand Up @@ -236,6 +242,12 @@ message Span {
// dropped_attributes_count is the number of dropped attributes. If the value is 0,
// then no attributes were dropped.
uint32 dropped_attributes_count = 5;

// Flags from the W3C traceparent, if provided.
jmacd marked this conversation as resolved.
Show resolved Hide resolved
// There are two flags defined in the W3C Trace Context Level 2 spec:
// - sampled = 0x1
// - random = 0x2
uint32 trace_flags = 6;
}

// links is a collection of Links, which are references from this span to a span
Expand Down