Chore: Update sqleng, elasticsearch, tempo and opentsdb plugins to support contextual logs. (#57777)

* make sql engine use pick log context for logs
* update tempo to get log context
* update opentsdb to use log context
* update es client to use log context
This commit is contained in:
Yuriy Tseretyan
2022-11-02 10:03:50 -04:00
committed by GitHub
parent 17ebeab02c
commit d9c40ca41e
13 changed files with 84 additions and 106 deletions
+4 -3
View File
@@ -11,9 +11,10 @@ import (
"github.com/grafana/grafana-plugin-sdk-go/backend/datasource"
"github.com/grafana/grafana-plugin-sdk-go/backend/instancemgmt"
"github.com/grafana/grafana-plugin-sdk-go/data"
"go.opentelemetry.io/collector/model/otlp"
"github.com/grafana/grafana/pkg/infra/httpclient"
"github.com/grafana/grafana/pkg/infra/log"
"go.opentelemetry.io/collector/model/otlp"
)
type Service struct {
@@ -85,7 +86,7 @@ func (s *Service) QueryData(ctx context.Context, req *backend.QueryDataRequest)
defer func() {
if err := resp.Body.Close(); err != nil {
s.tlog.Warn("failed to close response body", "err", err)
s.tlog.FromContext(ctx).Warn("failed to close response body", "err", err)
}
}()
@@ -132,7 +133,7 @@ func (s *Service) createRequest(ctx context.Context, dsInfo *datasourceInfo, tra
req.Header.Set("Accept", "application/protobuf")
s.tlog.Debug("Tempo request", "url", req.URL.String(), "headers", req.Header)
s.tlog.FromContext(ctx).Debug("Tempo request", "url", req.URL.String(), "headers", req.Header)
return req, nil
}