Skip to content

Commit

Permalink
added propagation to otel settings
Browse files Browse the repository at this point in the history
  • Loading branch information
erictg committed Apr 22, 2024
1 parent 4a97c56 commit 69bc6cb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/lifecycle/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/z5labs/bedrock/pkg/otelconfig"

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/propagation"
)

// ManageOTel is a hook for intializing OTel on PreBuild and shutting it down on PostRun.
Expand All @@ -27,6 +28,8 @@ func ManageOTel(f func(context.Context) (otelconfig.Initializer, error)) func(*b
return err
}
otel.SetTracerProvider(tp)
// need to set this so traces can propagate
otel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))
return nil
})

Expand Down

0 comments on commit 69bc6cb

Please sign in to comment.