What Grafana version and what operating system are you using?
Grafana v10.1.5 (849c612fcb)
What are you trying to achieve?
I would like to graph the maximum value as constant/threshold of a “complex” (joining and aggregation) time serie.
I’m graphing “complex” (joining and aggregating) time series about CPU usage. I’m computing the max value about one of them and would like to graph this computed “constant”
How are you trying to achieve it?
I tried to compute the maximum value using “Reduce” transformation:
- Mode:
Reduce field
- Calculations:
Max
- Include time:
false
What happened?
Output data didn’t contains time field so can’t be graphed (resumed):
[
refId: "my-data",
meta: {
type:"timeseries-multi"
preferredVisualisationType:"graph"
},
fields: [
{
name: "Value",
labels: {},
values: [
0.058099523086942904
]
]
]
What did you expect to happen?
Draw the unique value as a constant (or find out some way to graph it).
Can you copy/paste the configuration(s) that you are having problems with?
(example from https://play.grafana.org)
{
"id": 21,
"type": "timeseries",
"title": "Cluster CPU usage (by Namespace)",
"gridPos": {
"x": 12,
"y": 7,
"h": 16,
"w": 12
},
"fieldConfig": {
"defaults": {
"custom": {
"drawStyle": "line",
"lineInterpolation": "linear",
"barAlignment": 0,
"barWidthFactor": 0.6,
"lineWidth": 1,
"fillOpacity": 10,
"gradientMode": "none",
"spanNulls": false,
"insertNulls": false,
"showPoints": "never",
"pointSize": 5,
"stacking": {
"mode": "none",
"group": "A"
},
"axisPlacement": "auto",
"axisLabel": "",
"axisColorMode": "text",
"axisBorderShow": false,
"scaleDistribution": {
"type": "linear"
},
"axisCenteredZero": false,
"hideFrom": {
"tooltip": false,
"viz": false,
"legend": false
},
"thresholdsStyle": {
"mode": "off"
}
},
"color": {
"mode": "palette-classic"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"transformations": [
{
"id": "reduce",
"options": {
"reducers": [
"max"
],
"mode": "reduceFields",
"includeTimeField": false
},
"filter": {
"id": "byRefId",
"options": "/^(?:B)$/"
}
}
],
"pluginVersion": "11.5.0-81311",
"targets": [
{
"datasource": {
"uid": "${datasource}"
},
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{cluster=\"$cluster\"}) by (namespace)",
"interval": "",
"legendFormat": "{{namespace}}",
"refId": "A"
},
{
"datasource": {
"uid": "${datasource}"
},
"exemplar": true,
"expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{cluster=\"$cluster\"}) by (namespace)",
"interval": "",
"legendFormat": "{{namespace}}",
"refId": "B",
"hide": false
}
],
"datasource": {
"uid": "${datasource}"
},
"options": {
"tooltip": {
"mode": "single",
"sort": "none",
"hideZeros": false
},
"legend": {
"showLegend": true,
"displayMode": "list",
"placement": "bottom",
"calcs": []
}
}
}
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
N/A
Did you follow any online instructions? If so, what is the URL?
N/A