#How to work with OTEL tracer and custom spans in the Go SDK
1 messages · Page 1 of 1 (latest)
Interesting.. cc @spice drift might have an idea about why this might be happening?
I recall we ran into this not so long about the telemetry.Tracer or dagger.Tracer not being able to add spans to the current dagger call. In this case since it's via SDK, there's no dag.Tracer we can use 🤔
because that is technically in the dagger cli? and maybe we need to make the link with TRACEPARENT manually?
I tried with dagger run also and it doesn't work
dagger run is the one that initially creates the trace and sets the TRACEPARENT variable
you'll need a dagger.io/dagger/telemetry.Init() call in there somewhere (like func main()) to set up the OTel exporters and such
I added the following, and pass the otelCtx to the tr.Start(...) but still see nothing that indicates it is working
otelCtx := telemetry.Init(context.Background(), telemetry.Config{Detect: true})