Skip to content

Commit

Permalink
adding tracestate to trigger context
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed Sep 13, 2024
1 parent 8ff9b62 commit 56eddfe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/propagator.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,14 @@ func (p Propagator) getTextMapPropagator() propagation.TextMapPropagator {

func NewSpanContext(traceID string) trace.SpanContext {
parsedTraceID, _ := trace.TraceIDFromHex(traceID)
tracestate, _ := trace.ParseTraceState("tracetest=true")

var tf trace.TraceFlags
return trace.NewSpanContext(trace.SpanContextConfig{
TraceID: parsedTraceID,
SpanID: utils.SpanID(),
TraceFlags: tf.WithSampled(true),
TraceState: tracestate,
Remote: true,
})
}

0 comments on commit 56eddfe

Please sign in to comment.