Skip to content

Commit

Permalink
fix: Set OpenTelemetry metric provider to global
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstenson committed May 24, 2023
1 parent 59d41d4 commit 1ee9f61
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/otel/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ func setupMetrics(
sdkmetric.WithReader(sdkmetric.NewPeriodicReader(exporter)),
sdkmetric.WithResource(resource),
)
otel.SetMeterProvider(provider)

lifecycle.Append(fx.Hook{
OnStop: func(ctx context.Context) error {
return provider.Shutdown(ctx)
Expand Down

0 comments on commit 1ee9f61

Please sign in to comment.