fix (unified-storage): stop registering unified storage metrics in global state (#101322)

* move prometheus.register for unified storage metrics into metrics.go and do most of the plumbing to get it to work

* convert StorageApiMetrics to pointer and check for nil before using it

* rename type and variables to something more sensible

---------

Co-authored-by: Jean-Philippe Quéméner <jeanphilippe.quemener@grafana.com>
This commit is contained in:
Will Assis
2025-02-28 07:39:39 -05:00
committed by GitHub
co-authored by Jean-Philippe Quéméner
parent 7fb0d1b3e6
commit f5e5824bab
15 changed files with 108 additions and 106 deletions
+1
View File
@@ -31,6 +31,7 @@ func newNotifier(b *backend) (eventNotifier, error) {
tracer: b.tracer,
bulkLock: b.bulkLock,
listLatestRVs: b.listLatestRVs,
storageMetrics: b.storageMetrics,
historyPoll: func(ctx context.Context, grp string, res string, since int64) ([]*historyPollResponse, error) {
var records []*historyPollResponse
err := b.db.WithTx(ctx, ReadCommittedRO, func(ctx context.Context, tx db.Tx) error {