Skip to content

Commit

Permalink
fix: dont override set meter provider
Browse files Browse the repository at this point in the history
  • Loading branch information
markphelps committed Apr 24, 2024
1 parent 043fc7c commit 4bd8d49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import (
)

func init() {
otel.SetMeterProvider(metricnoop.NewMeterProvider())
if otel.GetMeterProvider() == nil {
otel.SetMeterProvider(metricnoop.NewMeterProvider())
}
}

// This is memoized in the OTEL library to avoid creating multiple instances of the same exporter.
Expand Down

0 comments on commit 4bd8d49

Please sign in to comment.