Results for queries with multiple series are ignored in some charts.
Summary
Most of our documentation indicates that metrics visualizations should be created from a "Range Query" (docs).
Range queries responses always of the type matrix
, which have separate rows of data (sometimes displayed as series). Sometimes only the first row of data is displayed.
Details
Range queries responses always of the type matrix
, which should be considered as a series of values in a multidimensional space. Range queries are returned in 2 basic forms:
- A single "result" is returned:
{
"status" : "success",
"data" : {
"resultType" : "matrix",
"result" : [ // single "row"
{
"metric" : {},
"values" : [
[ 1435781430.781, "1" ],
[ 1435781445.781, "1" ],
[ 1435781460.781, "1" ]
]
}
]
}
}
- Multiple "results" are returned, with the metric information identifying them:
{
"status" : "success",
"data" : {
"resultType" : "matrix",
"result" : [ // "rows"
{
"metric" : {
"__name__" : "up",
"job" : "prometheus",
"instance" : "localhost:9090"
},
"values" : [
[ 1435781430.781, "1" ], // "columns"
[ 1435781445.781, "1" ],
[ 1435781460.781, "1" ]
]
},
{
"metric" : {
"__name__" : "up",
"job" : "node",
"instance" : "localhost:9091"
},
"values" : [
[ 1435781430.781, "0" ],
[ 1435781445.781, "0" ],
[ 1435781460.781, "1" ]
]
}
]
}
}
Each result should be visualized with all the data it contains, each panel could contain 1-to-many metrics, and each metric 1-to-many row of results:
- Metric 1
- Row 1
- Row 2 ...
- Metric 2
- Row 1 ...
Task
We should define how many metrics does each chart support
- time series (must check) should show both multi metric results AND/OR multi row results.
- stack_column, only shows the first row of results https://gitlab.com/gitlab-org/gitlab/blob/ad256ac4bd9d35953b19f531356129cba0976ac4/app/assets/javascripts/monitoring/components/charts/column.vue#L48, and the first column https://gitlab.com/gitlab-org/gitlab/blob/ad256ac4bd9d35953b19f531356129cba0976ac4/app/assets/javascripts/monitoring/utils.js#L315.
- anomaly, only displays a single result row. https://gitlab.com/gitlab-org/gitlab/blob/ad256ac4bd9d35953b19f531356129cba0976ac4/app/assets/javascripts/monitoring/components/charts/anomaly.vue#L65 for each metric.
- heatmap possibly only shows a single row of results https://gitlab.com/gitlab-org/gitlab/blob/ad256ac4bd9d35953b19f531356129cba0976ac4/app/assets/javascripts/monitoring/components/charts/heatmap.vue#L45
- need to spend more time understanding other charts...