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:
co-authored by
Jean-Philippe Quéméner
parent
7fb0d1b3e6
commit
f5e5824bab
@@ -40,6 +40,7 @@ type BackendOptions struct {
|
||||
PollingInterval time.Duration
|
||||
WatchBufferSize int
|
||||
IsHA bool
|
||||
storageMetrics *resource.StorageMetrics
|
||||
|
||||
// testing
|
||||
SimulatedNetworkLatency time.Duration // slows down the create transactions by a fixed amount
|
||||
@@ -69,6 +70,7 @@ func NewBackend(opts BackendOptions) (Backend, error) {
|
||||
dbProvider: opts.DBProvider,
|
||||
pollingInterval: opts.PollingInterval,
|
||||
watchBufferSize: opts.WatchBufferSize,
|
||||
storageMetrics: opts.storageMetrics,
|
||||
bulkLock: &bulkLock{running: make(map[string]bool)},
|
||||
simulatedNetworkLatency: opts.SimulatedNetworkLatency,
|
||||
}, nil
|
||||
@@ -85,8 +87,9 @@ type backend struct {
|
||||
initErr error
|
||||
|
||||
// o11y
|
||||
log log.Logger
|
||||
tracer trace.Tracer
|
||||
log log.Logger
|
||||
tracer trace.Tracer
|
||||
storageMetrics *resource.StorageMetrics
|
||||
|
||||
// database
|
||||
dbProvider db.DBProvider
|
||||
|
||||
Reference in New Issue
Block a user