1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-07-17 01:12:45 +02:00

change TraceOptions to TraceFlags. (#144)

* change TraceOptions to TraceFlags.

* fix grammer in docs.
This commit is contained in:
rghetia
2019-09-25 14:37:36 -07:00
committed by GitHub
parent a853377a2f
commit e86b95c440
11 changed files with 91 additions and 91 deletions

View File

@ -24,19 +24,19 @@ type TraceID struct {
}
const (
traceOptionBitMaskSampled = byte(0x01)
traceOptionBitMaskUnused = byte(0xFE)
traceFlagsBitMaskSampled = byte(0x01)
traceFlagsBitMaskUnused = byte(0xFE)
// TraceOptionSampled is a byte with sampled bit set. It is a convenient value initialize
// SpanContext when a trace is sampled.
TraceOptionSampled = traceOptionBitMaskSampled
TraceOptionUnused = traceOptionBitMaskUnused
// TraceFlagsSampled is a byte with sampled bit set. It is a convenient value initializer
// for SpanContext TraceFlags field when a trace is sampled.
TraceFlagsSampled = traceFlagsBitMaskSampled
TraceFlagsUnused = traceFlagsBitMaskUnused
)
type SpanContext struct {
TraceID TraceID
SpanID uint64
TraceOptions byte
TraceID TraceID
SpanID uint64
TraceFlags byte
}
// EmptySpanContext is meant for internal use to return invalid span context during error conditions.
@ -67,5 +67,5 @@ func (sc SpanContext) TraceIDString() string {
}
func (sc SpanContext) IsSampled() bool {
return sc.TraceOptions&traceOptionBitMaskSampled == traceOptionBitMaskSampled
return sc.TraceFlags&traceFlagsBitMaskSampled == traceFlagsBitMaskSampled
}