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:
Ivana Huckova
2023-09-18 10:49:12 +02:00
committed by GitHub
co-authored by Sven Grossmann
parent c7b6ac065a
commit 4f0b31d21b
9 changed files with 71 additions and 18 deletions
+3 -2
View File
@@ -15,6 +15,7 @@ import (
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
)
func TestClient_ExecuteMultisearch(t *testing.T) {
@@ -67,7 +68,7 @@ func TestClient_ExecuteMultisearch(t *testing.T) {
To: to,
}
c, err := NewClient(context.Background(), &ds, timeRange, log.New("test", "test"))
c, err := NewClient(context.Background(), &ds, timeRange, log.New("test", "test"), tracing.NewFakeTracer())
require.NoError(t, err)
require.NotNil(t, c)
@@ -189,7 +190,7 @@ func TestClient_Index(t *testing.T) {
To: to,
}
c, err := NewClient(context.Background(), &ds, timeRange, log.New("test", "test"))
c, err := NewClient(context.Background(), &ds, timeRange, log.New("test", "test"), tracing.NewFakeTracer())
require.NoError(t, err)
require.NotNil(t, c)