Panel graffic - Line in legend goes backwards and shows a value that is not correct

Hello good afternoon, I am new to Grafana and I am trying to do the following.

A graph or time series panel showing the amount of MAC of a network device, with the min, max and current, but with a query transformation with “add field from calculation” which allows me to perform the summary with the calculation “Total” and “Replace all fields”. The problem is that the graph in some time ranges for example 12 hours shows 2 values within the legend at the same time which causes the timeline to go backwards and look like this

If I leave it at 12 hours, the min value becomes current so it looks that way. But if I leave it at 3 hours, it looks normal.

If I remove the
“Replace all fields“ from the transform to the query, all the fields that it brings do not have this problem and they show the correct values in any time range.

I am using a Grafana integrated with a Kubernets server cluster version :Grafana v7.5.9 (unknown-dev) with influxdb database.

Please help and thank you very much for your time.

Welcome @stomaswd

Which version of influx DB and which language are you using to perform the query?

That version of Grafana is very old, and I would not doubt that is why you see the weird results. Can you upgrade to the latest, even on a test machine just to see if it persists?

Hi grant2,

Thanks for the reply, the version of influxdb is as follows:
InfluxDB shell version: 1.8.2

I will review what you said to see the possibility of updating Grafana, as it is a pod within Kubernetes I do not really know how to do it.

and if I am not mistaken the language is JSON, I attach the query:

{
“aliasColors”: {},
“dashLength”: 10,
“fieldConfig”: {
“defaults”: {},
“overrides”:
},
“fill”: 2,
“fillGradient”: 1,
“gridPos”: {
“h”: 10,
“w”: 15,
“x”: 0,
“y”: 0
},
“id”: 23763571993,
“legend”: {
“alignAsTable”: true,
“avg”: false,
“current”: true,
“hideEmpty”: true,
“hideZero”: true,
“max”: true,
“min”: true,
“rightSide”: false,
“show”: true,
“total”: false,
“values”: true
},
“lines”: true,
“linewidth”: 1,
“nullPointMode”: “null”,
“options”: {
“alertThreshold”: false
},
“pluginVersion”: “7.5.9”,
“pointradius”: 1,
“renderer”: “flot”,
“seriesOverrides”: [
{
“$$hashKey”: “object:434”,
“alias”: “MAC COUNT”,
“points”: true
}
],
“spaceLength”: 10,
“targets”: [
{
“aggregation”: “disable”,
“device”: “$ACX7509”,
“deviceGroup”: “hb-default:acx-mgn”,
“deviceGroups”: [
“hb-default:acx-mgn”
],
“devices”: [
“$ACX7509”
],
“groupBy”: “*”,
“groupBys”: [
“device-id”,
“vlan-name”
],
“limitField”: “”,
“limitFunction”: “none”,
“limitNumber”: “”,
“limitType”: “none”,
“measurement”: “onnet-protocol.evpn/onnet-check-mac-count-netconf/mac-count”,
“orderByTime”: “asc”,
“policy”: “default”,
“query”: “[{"query_name":"insights_grafana","deviceGroup":"hb-default:acx-mgn","device":"$router","measurement":"onnet-packet-errors/onnet-check-in-errors-iagent/input-errors","fields":["input_errors"],"where":"$timeFilter","groupBy":["device-id","name"],"deviceAggregation":{}}]”,
“rawQuery”: false,
“refId”: “A”,
“resultFormat”: “time_series”,
“select”: [
[
{
“params”: [
“mac-count”
],
“type”: “field”
}
]
],
“tags”:
}
],
“thresholds”: ,
“timeRegions”: ,
“title”: “MAC COUNT”,
“tooltip”: {
“shared”: true,
“sort”: 0,
“value_type”: “individual”
},
“transformations”: [
{
“id”: “renameByRegex”,
“options”: {
“regex”: “”,
“renamePattern”: “”
}
},
{
“id”: “calculateField”,
“options”: {
“alias”: “MAC COUNT”,
“mode”: “reduceRow”,
“reduce”: {
“include”: ,
“reducer”: “sum”
},
“replaceFields”: true
}
}
],
“type”: “graph”,
“xaxis”: {
“buckets”: null,
“mode”: “time”,
“name”: null,
“show”: true,
“values”:
},
“yaxes”: [
{
“$$hashKey”: “object:462”,
“format”: “string”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
},
{
“$$hashKey”: “object:463”,
“format”: “short”,
“label”: null,
“logBase”: 1,
“max”: null,
“min”: null,
“show”: true
}
],
“yaxis”: {
“align”: true,
“alignLevel”: null
},
“bars”: false,
“dashes”: false,
“decimals”: null,
“hiddenSeries”: false,
“percentage”: false,
“points”: false,
“stack”: false,
“steppedLine”: false,
“timeFrom”: null,
“timeShift”: null,
“datasource”: null
}

What I also noticed is that for example if I download the graph data in CSV, I see that I have different values of the sum in the same time, and the end point in red square is the same value as the yellow square but with the difference of 1 second.
image

Anyway I will check Grafana to see how to update its version, I hope it is not something related to some delay or malfunction in the data pull that generates this problem.

Hi again. That is a very old version of InfluxDB and the query language you are using is likely InfluxQL. Is there any way that you can just start fresh and install everything in a new container or on new PC?

I can help you bring over the old data into the new system if it’s important to you.