mirror of
https://github.com/grafana/grafana.git
synced 2024-12-28 18:01:40 -06:00
Pyroscope: Decouple backend from infra imports (#80018)
Decouple backend from infra imports
This commit is contained in:
parent
6c8e30c96a
commit
81f8c022a0
@ -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"
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user