Elasticsearch: Add tracing to data source (#74750)
* Elasticsearch: Add tracing do data source * Fix tests * Address feedback * Update pkg/tsdb/elasticsearch/response_parser.go Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com> * Update pkg/tsdb/elasticsearch/response_parser.go Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com> * Track error across both spans * Add span for decoding of response * Fix test * Update setting of errors + fix test --------- Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
This commit is contained in:
co-authored by
Sven Grossmann
parent
c7b6ac065a
commit
4f0b31d21b
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/infra/tracing"
|
||||
es "github.com/grafana/grafana/pkg/tsdb/elasticsearch/client"
|
||||
)
|
||||
|
||||
@@ -3533,7 +3534,7 @@ func parseTestResponse(tsdbQueries map[string]string, responseBody string) (*bac
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return parseResponse(context.Background(), response.Responses, queries, configuredFields, log.New("test.logger"))
|
||||
return parseResponse(context.Background(), response.Responses, queries, configuredFields, log.New("test.logger"), tracing.NewFakeTracer())
|
||||
}
|
||||
|
||||
func requireTimeValue(t *testing.T, expected int64, frame *data.Frame, index int) {
|
||||
@@ -3583,7 +3584,7 @@ func requireStringAt(t *testing.T, expected string, field *data.Field, index int
|
||||
|
||||
func requireFloatAt(t *testing.T, expected float64, field *data.Field, index int) {
|
||||
v := field.At(index).(*float64)
|
||||
require.Equal(t, expected, *v, fmt.Sprintf("wrong flaot at index %v", index))
|
||||
require.Equal(t, expected, *v, fmt.Sprintf("wrong float at index %v", index))
|
||||
}
|
||||
|
||||
func requireTimeSeriesName(t *testing.T, expected string, frame *data.Frame) {
|
||||
|
||||
Reference in New Issue
Block a user