Plugins: Fix loading of backend plugins (#27951)

Ref #27921
This commit is contained in:
Marcus Efraimsson
2020-10-01 10:39:42 +02:00
committed by GitHub
parent 298ac20dc5
commit 747513d444
4 changed files with 34 additions and 30 deletions

View File

@@ -10,7 +10,7 @@ import (
"sync"
"time"
"github.com/grafana/grafana/pkg/infra/metrics"
"github.com/grafana/grafana/pkg/infra/metrics/metricutil"
"github.com/grafana/grafana/pkg/setting"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -73,7 +73,7 @@ type dataSourceTransport struct {
func instrumentRoundtrip(datasourceName string, next http.RoundTripper) promhttp.RoundTripperFunc {
return promhttp.RoundTripperFunc(func(r *http.Request) (*http.Response, error) {
datasourceLabelName, err := metrics.SanitizeLabelName(datasourceName)
datasourceLabelName, err := metricutil.SanitizeLabelName(datasourceName)
// if the datasource named cannot be turned into a prometheus
// label we will skip instrumenting these metrics.
if err != nil {