Tracing: Standardize on otel tracing (#75528)
This commit is contained in:
@@ -143,17 +143,18 @@ func (s *Service) QueryData(ctx context.Context, req *backend.QueryDataRequest)
|
||||
defer span.End()
|
||||
|
||||
targetStr := strings.Join(formData["target"], ",")
|
||||
span.SetAttributes("target", targetStr, attribute.Key("target").String(targetStr))
|
||||
span.SetAttributes("from", from, attribute.Key("from").String(from))
|
||||
span.SetAttributes("until", until, attribute.Key("until").String(until))
|
||||
span.SetAttributes("datasource_id", dsInfo.Id, attribute.Key("datasource_id").Int64(dsInfo.Id))
|
||||
span.SetAttributes("org_id", req.PluginContext.OrgID, attribute.Key("org_id").Int64(req.PluginContext.OrgID))
|
||||
|
||||
span.SetAttributes(
|
||||
attribute.String("target", targetStr),
|
||||
attribute.String("from", from),
|
||||
attribute.String("until", until),
|
||||
attribute.Int64("datasource_id", dsInfo.Id),
|
||||
attribute.Int64("org_id", req.PluginContext.OrgID),
|
||||
)
|
||||
s.tracer.Inject(ctx, graphiteReq.Header, span)
|
||||
|
||||
res, err := dsInfo.HTTPClient.Do(graphiteReq)
|
||||
if res != nil {
|
||||
span.SetAttributes("graphite.response.code", res.StatusCode, attribute.Key("graphite.response.code").Int(res.StatusCode))
|
||||
span.SetAttributes(attribute.Int("graphite.response.code", res.StatusCode))
|
||||
}
|
||||
if err != nil {
|
||||
span.RecordError(err)
|
||||
|
||||
Reference in New Issue
Block a user