-
What Grafana version and what operating system are you using?
grafana cloud + prom-client + node.js -
What are you trying to achieve?
Draw a chart about a counter metric increase.
- How are you trying to achieve it?
I tried query sum(CLS)
, it shows the total count correctly, but is not the increase count of each time span I want :
Then I tried sum(increase(CLS[10m]))
query.
-
What happened?
I got all 0 value, which is not my expect:
-
What did you expect to happen?
The value of chart should be increase count of each time span, not all 0 value.
My CLS metric has different label value, eg:
- {name: âCLSâ, delta: 123 }
- {name: âCLSâ, delta: 456 }
- {name: âCLSâ, delta: 789 }
Does the different label value result to all 0 increase value? Should I avoid different label value?
- Can you copy/paste the configuration(s) that you are having problems with?
Here is my config of chart:
{
"id": 9,
"type": "timeseries",
"title": "test",
"gridPos": {
"x": 0,
"y": 21,
"h": 8,
"w": 24
},
"fieldConfig": {
"defaults": {
"custom": {
"drawStyle": "line",
"lineInterpolation": "linear",
"barAlignment": 0,
"barWidthFactor": 0.6,
"lineWidth": 1,
"fillOpacity": 59,
"gradientMode": "none",
"spanNulls": false,
"insertNulls": false,
"showPoints": "never",
"pointSize": 5,
"stacking": {
"mode": "normal",
"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
}
]
},
"unit": "none"
},
"overrides": []
},
"pluginVersion": "11.6.0-84214",
"targets": [
{
"disableTextWrap": false,
"editorMode": "code",
"exemplar": false,
"expr": "sum(CLS) - sum(CLS offset 10m)",
"fullMetaSearch": false,
"hide": true,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "A",
"useBackend": false
},
{
"disableTextWrap": false,
"editorMode": "builder",
"exemplar": false,
"expr": "sum(increase(CLS[$__rate_interval]))",
"fullMetaSearch": false,
"hide": false,
"includeNullMetadata": true,
"legendFormat": "__auto",
"range": true,
"refId": "E",
"useBackend": false,
"datasource": {
"uid": "grafanacloud-prom",
"type": "prometheus"
}
}
],
"datasource": {
"type": "prometheus",
"uid": "grafanacloud-prom"
},
"interval": "10m",
"options": {
"tooltip": {
"mode": "multi",
"sort": "none",
"hideZeros": false
},
"legend": {
"showLegend": true,
"displayMode": "table",
"placement": "right",
"calcs": [
"sum",
"min",
"max"
]
}
}
}
-
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
No errors. -
Did you follow any online instructions? If so, what is the URL?
Related issues :