- What Grafana version and what operating system are you using?
Grafana 12.2, Windows/Chrome (for client; for servers - some Linux in the cloud)
- What are you trying to achieve?
I have 2 metrics, one produces let’s say 40 time series for a given label, the other - 100 (and those 40 among them). I want to display max values for each of the time series next to label value in a table, like this:
- serviceA, max heap size, container limit
- serviceB, max heap size, container limit
- and so on
- How are you trying to achieve it?
in a dashboard I have 2 queries:
memory_limit: max by (container) (container_spec_memory_limit_bytes{k8s_cluster=“prod”})
jvm_memory_used_bytes: max by (container) (jvm_memory_used_bytes{k8s_cluster=“prod”, area=“heap”}); I keep them “hidden”
and 2 expressions, both “Reduce/max” configuration for corresponding query
- What happened?
so what I have is a table view with a “drop down selector” where I can only choose one value at a time for display, which look like this:
- memory_limit_max serviceA
- memory_limit_max serviceB
… - jvm_used_bytes_max serviceA
- jvm_used_bytes_max serviceB
etc.
- What did you expect to happen?
not that I expected something right away, but how do I merge these 2 sets of time series, leaving only those that have matching label value in both; and then display them in one table without having to select anything?
- Can you copy/paste the configuration(s) that you are having problems with?
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 1090,
"links": [],
"panels": [
{
"datasource": {
"default": false,
"type": "prometheus",
"uid": "metrics-prod"
},
"fieldConfig": {
"defaults": {
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"cellHeight": "sm",
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"showHeader": true
},
"pluginVersion": "11.2.2+security-01",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "metrics-prod"
},
"editorMode": "code",
"expr": "max by (container) (container_spec_memory_limit_bytes{k8s_cluster=\"prod\"})",
"hide": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "memory_limit"
},
{
"datasource": {
"name": "Expression",
"type": "__expr__",
"uid": "__expr__"
},
"expression": "memory_limit",
"hide": false,
"reducer": "max",
"refId": "memory_limit_max",
"type": "reduce"
},
{
"datasource": {
"type": "prometheus",
"uid": "metrics-prod"
},
"editorMode": "code",
"expr": "max by (container) (jvm_memory_used_bytes{k8s_cluster=\"prod\", area=\"heap\"})",
"hide": true,
"instant": false,
"legendFormat": "__auto",
"range": true,
"refId": "jvm_memory_used_bytes"
},
{
"datasource": {
"name": "Expression",
"type": "__expr__",
"uid": "__expr__"
},
"expression": "jvm_memory_used_bytes",
"hide": false,
"reducer": "max",
"refId": "jvm_memory_used_bytes_max",
"type": "reduce"
}
],
"title": "Panel Title",
"type": "table"
}
],
"schemaVersion": 39,
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "Europe/Tallinn",
"title": "experimental",
"uid": "be7hy1f17vzeoa",
"version": 1,
"weekStart": ""
}
- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
no
- Did you follow any online instructions? If so, what is the URL?
no