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

Make TraceFlags spec-compliant #1770

Merged
merged 4 commits into from
Apr 5, 2021

Conversation

Aneurysm9
Copy link
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>
@codecov
Copy link

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%) ⬆️

trace/trace.go Outdated Show resolved Hide resolved
trace/trace.go Show resolved Hide resolved
@MrAlias MrAlias merged commit c6b92d5 into open-telemetry:main Apr 5, 2021
@MrAlias MrAlias mentioned this pull request Apr 23, 2021
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
4 participants