Pyroscope: Decouple backend from infra imports (#80018)

Decouple backend from infra imports
This commit is contained in:
Joey 2024-01-08 13:11:46 +00:00 committed by GitHub
parent 6c8e30c96a
commit 81f8c022a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -11,10 +11,10 @@ import (
"time"
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
"github.com/grafana/grafana-plugin-sdk-go/backend/tracing"
"github.com/grafana/grafana-plugin-sdk-go/data"
"github.com/grafana/grafana/pkg/infra/httpclient"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/promql/parser"
"go.opentelemetry.io/otel/attribute"

View File

@ -10,7 +10,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend/datasource"
"github.com/grafana/grafana-plugin-sdk-go/backend/httpclient"
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana-plugin-sdk-go/backend/log"
)
// Make sure PyroscopeDatasource implements required interfaces. This is important to do
@ -34,7 +34,7 @@ type Service struct {
logger log.Logger
}
var logger = log.New("tsdb.pyroscope")
var logger = backend.NewLoggerWith("logger", "tsdb.pyroscope")
// Return the file, line, and (full-path) function name of the caller
func getRunContext() (string, int, string) {
@ -72,7 +72,7 @@ func ProvideService(httpClientProvider *httpclient.Provider) *Service {
func newInstanceSettings(httpClientProvider *httpclient.Provider) datasource.InstanceFactoryFunc {
return func(ctx context.Context, settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error) {
return NewPyroscopeDatasource(ctx, httpClientProvider, settings)
return NewPyroscopeDatasource(ctx, *httpClientProvider, settings)
}
}