diff --git a/pkg/tsdb/tempo/metrics_stream.go b/pkg/tsdb/tempo/metrics_stream.go index 145dc876c53..8bd1cae71c4 100644 --- a/pkg/tsdb/tempo/metrics_stream.go +++ b/pkg/tsdb/tempo/metrics_stream.go @@ -7,13 +7,11 @@ import ( "fmt" "io" - "github.com/grafana/grafana/pkg/tsdb/tempo/traceql" - stream_utils "github.com/grafana/grafana/pkg/tsdb/tempo/utils" - "google.golang.org/grpc/metadata" - "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana/pkg/tsdb/tempo/kinds/dataquery" + "github.com/grafana/grafana/pkg/tsdb/tempo/traceql" + stream_utils "github.com/grafana/grafana/pkg/tsdb/tempo/utils" "github.com/grafana/tempo/pkg/tempopb" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" diff --git a/pkg/tsdb/tempo/search_stream.go b/pkg/tsdb/tempo/search_stream.go index 47c482f813b..7a449c46058 100644 --- a/pkg/tsdb/tempo/search_stream.go +++ b/pkg/tsdb/tempo/search_stream.go @@ -7,8 +7,6 @@ import ( "fmt" "io" - "google.golang.org/grpc/metadata" - "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/backend/tracing" "github.com/grafana/grafana-plugin-sdk-go/data" diff --git a/pkg/tsdb/tempo/stream_handler.go b/pkg/tsdb/tempo/stream_handler.go index 371ab7e32d4..946bd7c69f4 100644 --- a/pkg/tsdb/tempo/stream_handler.go +++ b/pkg/tsdb/tempo/stream_handler.go @@ -50,8 +50,8 @@ func (s *Service) RunStream(ctx context.Context, request *backend.RunStreamReque request.Headers = headers if strings.HasPrefix(request.Path, SearchPathPrefix) { - if err != nil { - return backend.DownstreamErrorf("failed to get datasource information: %w", err) + if dsInfoErr != nil { + return backend.DownstreamErrorf("failed to get datasource information: %w", dsInfoErr) } if err = s.runSearchStream(ctx, request, sender, tempoDatasource); err != nil { return sendError(err, sender) @@ -60,8 +60,8 @@ func (s *Service) RunStream(ctx context.Context, request *backend.RunStreamReque } } if strings.HasPrefix(request.Path, MetricsPathPrefix) { - if err != nil { - return backend.DownstreamErrorf("failed to get datasource information: %w", err) + if dsInfoErr != nil { + return backend.DownstreamErrorf("failed to get datasource information: %w", dsInfoErr) } if err = s.runMetricsStream(ctx, request, sender, tempoDatasource); err != nil { return sendError(err, sender)