Support Datadog tracer priority sampling
This commit is contained in:
parent
e5fb1ffeb7
commit
0de1ff8634
14 changed files with 226 additions and 82 deletions
9
vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/spancontext.go
generated
vendored
9
vendor/gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer/spancontext.go
generated
vendored
|
@ -16,9 +16,9 @@ var _ ddtrace.SpanContext = (*spanContext)(nil)
|
|||
type spanContext struct {
|
||||
// the below group should propagate only locally
|
||||
|
||||
trace *trace // reference to the trace that this span belongs too
|
||||
span *span // reference to the span that hosts this context
|
||||
sampled bool // whether this span will be sampled or not
|
||||
trace *trace // reference to the trace that this span belongs too
|
||||
span *span // reference to the span that hosts this context
|
||||
drop bool // when true, the span will not be sent to the agent
|
||||
|
||||
// the below group should propagate cross-process
|
||||
|
||||
|
@ -40,7 +40,6 @@ func newSpanContext(span *span, parent *spanContext) *spanContext {
|
|||
context := &spanContext{
|
||||
traceID: span.TraceID,
|
||||
spanID: span.SpanID,
|
||||
sampled: true,
|
||||
span: span,
|
||||
}
|
||||
if v, ok := span.Metrics[samplingPriorityKey]; ok {
|
||||
|
@ -49,7 +48,7 @@ func newSpanContext(span *span, parent *spanContext) *spanContext {
|
|||
}
|
||||
if parent != nil {
|
||||
context.trace = parent.trace
|
||||
context.sampled = parent.sampled
|
||||
context.drop = parent.drop
|
||||
context.hasPriority = parent.hasSamplingPriority()
|
||||
context.priority = parent.samplingPriority()
|
||||
parent.ForeachBaggageItem(func(k, v string) bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue