You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-08-10 22:31:50 +02:00
trace/auto pass stack allocated span context var to ebpf (#6434)
same as https://github.com/open-telemetry/opentelemetry-go-instrumentation/pull/1971 Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
@@ -57,14 +57,15 @@ type autoTracer struct {
|
|||||||
var _ Tracer = autoTracer{}
|
var _ Tracer = autoTracer{}
|
||||||
|
|
||||||
func (t autoTracer) Start(ctx context.Context, name string, opts ...SpanStartOption) (context.Context, Span) {
|
func (t autoTracer) Start(ctx context.Context, name string, opts ...SpanStartOption) (context.Context, Span) {
|
||||||
var psc SpanContext
|
var psc, sc SpanContext
|
||||||
sampled := true
|
sampled := true
|
||||||
span := new(autoSpan)
|
span := new(autoSpan)
|
||||||
|
|
||||||
// Ask eBPF for sampling decision and span context info.
|
// Ask eBPF for sampling decision and span context info.
|
||||||
t.start(ctx, span, &psc, &sampled, &span.spanContext)
|
t.start(ctx, span, &psc, &sampled, &sc)
|
||||||
|
|
||||||
span.sampled.Store(sampled)
|
span.sampled.Store(sampled)
|
||||||
|
span.spanContext = sc
|
||||||
|
|
||||||
ctx = ContextWithSpan(ctx, span)
|
ctx = ContextWithSpan(ctx, span)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user