Merged in feature/common-metrics (pull request #73)
Add common metrics * add common metrics and sample for using * updates * attempt integration * wip * working stubs generate * docs * comments * Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/common-metrics * runner metrics all * exclude generated from the coverage * fix lint * refactor metrics * change .gen filename * new gen * Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/common-metrics * docs * main merge * refactor * add to generate * merge main
This commit is contained in:
@@ -37,5 +37,21 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// optional add shutdown metrics
|
||||
defer func() {
|
||||
err = cfg.GetMetrics().RecordLifecycleEvent(1.0, "shutdown", "main")
|
||||
|
||||
if err != nil {
|
||||
slog.Error("Failed to record shutdown metric ", "error", err)
|
||||
}
|
||||
}()
|
||||
|
||||
// start and block until server is done
|
||||
server.Listen(ctx)
|
||||
|
||||
// optional shutdown
|
||||
metrics := cfg.GetMetrics()
|
||||
if err := metrics.Shutdown(ctx); err != nil {
|
||||
slog.Error("Error shutting down metrics server", "error", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user