mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Prometheus: Add ExecutedQueryString to first frame only (#73678)
This commit is contained in:
parent
a01a903492
commit
fe774415b5
@ -41,11 +41,14 @@ func (s *QueryData) parseResponse(ctx context.Context, q *models.Query, res *htt
|
||||
}
|
||||
|
||||
// The ExecutedQueryString can be viewed in QueryInspector in UI
|
||||
for _, frame := range r.Frames {
|
||||
for i, frame := range r.Frames {
|
||||
if s.enableWideSeries {
|
||||
addMetadataToWideFrame(q, frame)
|
||||
} else {
|
||||
addMetadataToMultiFrame(q, frame, s.enableDataplane)
|
||||
if i == 0 {
|
||||
frame.Meta.ExecutedQueryString = executedQueryString(q)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +115,6 @@ func addMetadataToMultiFrame(q *models.Query, frame *data.Frame, enableDataplane
|
||||
if frame.Meta == nil {
|
||||
frame.Meta = &data.FrameMeta{}
|
||||
}
|
||||
frame.Meta.ExecutedQueryString = executedQueryString(q)
|
||||
if len(frame.Fields) < 2 {
|
||||
return
|
||||
}
|
||||
|
@ -7,8 +7,7 @@
|
||||
// ],
|
||||
// "custom": {
|
||||
// "resultType": "exemplar"
|
||||
// },
|
||||
// "executedQueryString": "Expr: histogram_quantile(0.99, sum(rate(traces_spanmetrics_duration_seconds_bucket[15s])) by (le))\nStep: 15s"
|
||||
// }
|
||||
// }
|
||||
// Name: exemplar
|
||||
// Dimensions: 14 Fields by 62 Rows
|
||||
@ -44,8 +43,7 @@
|
||||
],
|
||||
"custom": {
|
||||
"resultType": "exemplar"
|
||||
},
|
||||
"executedQueryString": "Expr: histogram_quantile(0.99, sum(rate(traces_spanmetrics_duration_seconds_bucket[15s])) by (le))\nStep: 15s"
|
||||
}
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
|
@ -33,8 +33,7 @@
|
||||
// ],
|
||||
// "custom": {
|
||||
// "resultType": "matrix"
|
||||
// },
|
||||
// "executedQueryString": "Expr: \nStep: 1s"
|
||||
// }
|
||||
// }
|
||||
// Name: prometheus_http_requests_total{code="400", handler="/api/v1/query_range", job="prometheus"}
|
||||
// Dimensions: 2 Fields by 2 Rows
|
||||
@ -121,8 +120,7 @@
|
||||
],
|
||||
"custom": {
|
||||
"resultType": "matrix"
|
||||
},
|
||||
"executedQueryString": "Expr: \nStep: 1s"
|
||||
}
|
||||
},
|
||||
"fields": [
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user