Skip to content

Make TraceFlags spec-compliant#1770

Merged
MrAlias merged 4 commits intoopen-telemetry:mainfrom
Aneurysm9:span_context_trace_flags
Apr 5, 2021
Merged

Make TraceFlags spec-compliant#1770
MrAlias merged 4 commits intoopen-telemetry:mainfrom
Aneurysm9:span_context_trace_flags

Conversation

@Aneurysm9
Copy link
Copy Markdown
Member

  • Remove trace.FlagsDebug and trace.FlagsDeferred
    • These are used only by the B3 propagator and will be handled there in the context.Context
  • Make trace.TraceFlags a defined type, aliasing byte
  • Move IsSampled method from trace.SpanContext to trace.TraceFlags
  • Add Sampled(bool) method to trace.TraceFlags
  • Implement Stringer and json.Marshaler for trace.TraceFlags

Fixes #1515. Closes #1516.

* Remove `trace.FlagsDebug` and `trace.FlagsDeferred`
  * These are used only by the B3 propagator and will be handled there in the `context.Context`
* Make `trace.TraceFlags` a defined type, aliasing `byte`
* Move `IsSampled` method from `trace.SpanContext` to `trace.TraceFlags`
* Add `Sampled(bool)` method to `trace.TraceFlags`
* Implement `Stringer` and `json.Marshaler` for `trace.TraceFlags`

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
@Aneurysm9 Aneurysm9 force-pushed the span_context_trace_flags branch from cad7d2c to 5ad4d1b Compare April 1, 2021 22:59
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2021

Codecov Report

Merging #1770 (7e1737e) into main (ee687ca) will increase coverage by 0.0%.
The diff coverage is 84.6%.

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #1770   +/-   ##
=====================================
  Coverage   78.5%   78.6%           
=====================================
  Files        134     134           
  Lines       7126    7129    +3     
=====================================
+ Hits        5600    5605    +5     
+ Misses      1277    1275    -2     
  Partials     249     249           
Impacted Files Coverage Δ
trace/trace.go 86.7% <71.4%> (+0.3%) ⬆️
bridge/opencensus/utils/utils.go 100.0% <100.0%> (ø)
propagation/trace_context.go 69.6% <100.0%> (+0.4%) ⬆️
sdk/trace/simple_span_processor.go 85.0% <100.0%> (ø)
exporters/otlp/otlpgrpc/connection.go 90.6% <0.0%> (+1.8%) ⬆️

Comment thread trace/trace.go Outdated
Comment thread trace/trace.go
@MrAlias MrAlias merged commit c6b92d5 into open-telemetry:main Apr 5, 2021
@MrAlias MrAlias mentioned this pull request Apr 23, 2021
@pellared pellared added this to the untracked milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recommend to make traceflags a struct Remove undefined trace flags

5 participants