open-telemetry / opentelemetry-proto

OpenTelemetry protocol (OTLP) specification and Protobuf definitions
https://opentelemetry.io/docs/specs/otlp/
Apache License 2.0
545 stars 242 forks source link

SPAN_FLAGS_TRACE_FLAGS_MASK is not defined #526

Closed breedx-splk closed 5 months ago

breedx-splk commented 5 months ago

The trace protos now contain a flags field, part of which is the trace flags...and a comment says:

// To read the 8-bit W3C trace flag, use `flags & SPAN_FLAGS_TRACE_FLAGS_MASK`.

I don't know protobufs well enough to say if a constant value can be provided, but I didn't see one. If it can be provided as a constant, we should add it....and if not we should let people know to mask with 0x000000ff.

tigrannajaryan commented 5 months ago

I think this is the constant: https://github.com/open-telemetry/opentelemetry-proto/blob/34d29fe5ad4689b5db0259d3750de2bfa195bc85/opentelemetry/proto/trace/v1/trace.proto#L330

breedx-splk commented 5 months ago

Ok thanks @tigrannajaryan. I guess I can live with that. Would have made more sense if it said

// To read the 8-bit W3C trace flag, use `flags & SpanFlags.SPAN_FLAGS_TRACE_FLAGS_MASK`.

or something....but ok, at least it's defined.

tigrannajaryan commented 5 months ago

Ok thanks @tigrannajaryan. I guess I can live with that. Would have made more sense if it said

// To read the 8-bit W3C trace flag, use `flags & SpanFlags.SPAN_FLAGS_TRACE_FLAGS_MASK`.

or something....but ok, at least it's defined.

Yes, I think that would be more precise. Feel free to submit a PR.