Elasticsearch: Improve backend instrumentation of QueryData calls (#74172)

* Elasticsearch: Improve backend instrumentation of QueryData calls

* Add fromAlert

* Fix tests, move logger and context to struct

* Add instrumentation for processing response

* Move log for sending request closer to sending request

* Update

* Fix logging, improved messages, fix printing of queries

* Update log text

* Fix tests

* Fix lint

* Update logging to follow our guidelines

* Remove key-value pairs from logs that are going to be passed from instrumentation

* Update pkg/tsdb/elasticsearch/elasticsearch.go
This commit is contained in:
Ivana Huckova
2023-09-07 13:54:16 +02:00
committed by GitHub
parent 7e01dde762
commit 51391a762b
11 changed files with 102 additions and 59 deletions
+2 -1
View File
@@ -3,6 +3,7 @@ package elasticsearch
import (
"testing"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/stretchr/testify/require"
)
@@ -60,7 +61,7 @@ func TestParseQuery(t *testing.T) {
}`
dataQuery, err := newDataQuery(body)
require.NoError(t, err)
queries, err := parseQuery(dataQuery.Queries)
queries, err := parseQuery(dataQuery.Queries, log.New("test.logger"))
require.NoError(t, err)
require.Len(t, queries, 1)