I have a large number of custom metrics like:
Request_GetData_XXXX_duration_seconds_sum
Request_GetData_XXXX_duration_seconds_count
Request_GetData_YYYY_duration_seconds_sum
Request_GetData_YYYY_duration_seconds_count
Their number and names (XXXX and YYYY) may change, but they are always paired and end in _sum
and _count.
In Grafana, I draw an Average plot in the following way:
sum by (container) (
rate(Request_GetData_XXXX_duration_seconds_sum{}[5m]) /
rate(Request_GetData_XXXX_duration_seconds_count{}[5m]) )
Everything works.
I made a drop down menu and through a variable
{name=~"Request_GetData_.*_seconds_count$"}
And Regex /(.+)_count{/
get a list of metrics
result:
- Request_GetData_XXXX_duration_seconds
- Request_GetData_YYYY_duration_seconds
And in Grafana I write in the request:
sum by (container) (rate(${myVar_metrics}_sum{}[5m]) / rate(${myVar_metrics}_count{}[5m]))
Everything is working. But I need the following. I need one graph on which there will be all the metrics Request_GetData_XXXX_duration_seconds
, Request_GetData_YYYY_duration_seconds
and etc.
Tell me how can this be done? The Multi-value and Include All option options on a variable break such a graph.