Skip to content

Commit

Permalink
feat: shutdown otel metrics provider
Browse files Browse the repository at this point in the history
The provider will handle shutting down it's resources, including the
reader.

relates to [PE-910](https://einride.atlassian.net/browse/PE-910)
  • Loading branch information
alethenorio committed Aug 5, 2024
1 parent 6abad7a commit 1ac9e65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cloudotel/metricexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ func StartMetricExporter(
)
otel.SetMeterProvider(provider)
shutdown := func() {
if err := reader.Shutdown(context.Background()); err != nil {
if err := provider.Shutdown(context.Background()); err != nil {
if logger, ok := cloudzap.GetLogger(ctx); ok {
logger.Warn("error stopping periodic reader, final metric export might have failed", zap.Error(err))
logger.Warn("error stopping metric provider, final metric export might have failed", zap.Error(err))
}
}
}
Expand Down

0 comments on commit 1ac9e65

Please sign in to comment.