Skip to content

Commit

Permalink
feat: add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag authored and flemzord committed Jul 31, 2023
1 parent 69a9936 commit 3685e36
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libs/otlp/otlpmetrics/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,15 @@ func MetricsModule(cfg ModuleConfig) fx.Option {
return nil
},
OnStop: func(ctx context.Context) error {
logging.FromContext(ctx).Infof("Flush metrics")
if err := metricProvider.ForceFlush(ctx); err != nil {
logging.FromContext(ctx).Errorf("unable to flush metrics: %s", err)
}
logging.FromContext(ctx).Infof("Shutting down metrics provider")
if err := metricProvider.Shutdown(ctx); err != nil {
logging.FromContext(ctx).Errorf("unable to shutdown metrics provider: %s", err)
}
logging.FromContext(ctx).Infof("Metrics provider stopped")
return nil
},
})
Expand Down

0 comments on commit 3685e36

Please sign in to comment.