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:
Jay Brown
2025-03-05 16:59:01 +00:00
parent 0af049e96f
commit ab28cf30db
13 changed files with 865 additions and 84 deletions
+16
View File
@@ -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)
}
}