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
@@ -11,6 +11,7 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend"
"github.com/grafana/grafana/pkg/infra/log"
es "github.com/grafana/grafana/pkg/tsdb/elasticsearch/client"
)
@@ -137,7 +138,7 @@ func queryDataTestWithResponseCode(queriesBytes []byte, responseStatusCode int,
return nil
})
result, err := queryData(context.Background(), queries, dsInfo)
result, err := queryData(context.Background(), queries, dsInfo, log.New("test.logger"))
if err != nil {
return queryDataTestResult{}, err
}