Chore: Let wire inject prometheus.Registerer (#62195)

let wire inject prometheus.Registerer
This commit is contained in:
Serge Zaitsev
2023-02-28 16:12:23 +01:00
committed by GitHub
parent ec82719372
commit 2f8ee38c5e
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -6,6 +6,7 @@ import (
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/metrics/graphitebridge"
"github.com/grafana/grafana/pkg/setting"
"github.com/prometheus/client_golang/prometheus"
)
var metricsLogger log.Logger = log.New("metrics")
@@ -53,3 +54,6 @@ func (im *InternalMetricsService) Run(ctx context.Context) error {
<-ctx.Done()
return ctx.Err()
}
func ProvideRegisterer() prometheus.Registerer { return prometheus.DefaultRegisterer }
func ProvideRegistererForTest() prometheus.Registerer { return prometheus.NewRegistry() }