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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user