Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.6.2 -> 5.1.0: Graph, axes unit "none" does not show original decimals precision anymore #11792

Closed
tw-bert opened this issue May 1, 2018 · 4 comments · Fixed by #12123
Closed

Comments

@tw-bert
Copy link

tw-bert commented May 1, 2018

What Grafana version are you using?

grafana_5.1.0_amd64.deb

What datasource are you using?

InfluxDB

What OS are you running grafana on?

ubuntu.xenial64

What did you do?

Copied grafana.db from our live system to a separate VM, upgraded to Grafana 5.1.0 to check for issues

What was the expected result?

To see the same data with the same precision. '1.01' must stay '1.01' in the legend and the tooltip.

What happened instead?

'1.01' becomes '1' in Grafana 5.1.0

Grafana 4.x:
image

Grafana 5.1.0:
image

Both Axes are configured the same:
image

Here is the full JSON of the panel (Grafana 4.6.2):

{
  "aliasColors": {},
  "bars": false,
  "dashLength": 10,
  "dashes": false,
  "datasource": "$datasource",
  "editable": true,
  "error": false,
  "fill": 1,
  "grid": {},
  "id": 65537,
  "interval": "$inter",
  "legend": {
    "alignAsTable": true,
    "avg": true,
    "current": true,
    "hideEmpty": true,
    "hideZero": true,
    "max": true,
    "min": true,
    "rightSide": true,
    "show": true,
    "total": false,
    "values": true,
    "sortDesc": true,
    "sort": "current"
  },
  "lines": true,
  "linewidth": 1,
  "links": [],
  "nullPointMode": "connected",
  "percentage": false,
  "pointradius": 5,
  "points": false,
  "renderer": "flot",
  "seriesOverrides": [],
  "spaceLength": 10,
  "span": 10,
  "stack": false,
  "steppedLine": false,
  "targets": [
    {
      "alias": "$tag_host:$tag_port $tag_env - $col",
      "dsType": "influxdb",
      "groupBy": [
        {
          "params": [
            "$interval"
          ],
          "type": "time"
        },
        {
          "params": [
            "null"
          ],
          "type": "fill"
        }
      ],
      "measurement": "redis_used_cpu_sys",
      "orderByTime": "ASC",
      "policy": "default",
      "query": "SELECT mean(\"mem_fragmentation_ratio\") as \"frag\" FROM \"$rp\".\"redis\" WHERE host =~ /$server$/ AND $timeFilter GROUP BY time($interval),* fill(none)",
      "rawQuery": true,
      "refId": "C",
      "resultFormat": "time_series",
      "select": [
        [
          {
            "params": [
              "value"
            ],
            "type": "field"
          },
          {
            "params": [],
            "type": "mean"
          }
        ]
      ],
      "tags": []
    }
  ],
  "thresholds": [],
  "timeFrom": null,
  "timeShift": null,
  "title": "Memory Fragmentation",
  "tooltip": {
    "shared": true,
    "sort": 0,
    "value_type": "cumulative"
  },
  "type": "graph",
  "xaxis": {
    "buckets": null,
    "mode": "time",
    "name": null,
    "show": true,
    "values": []
  },
  "yaxes": [
    {
      "format": "none",
      "logBase": 1,
      "max": null,
      "min": null,
      "show": true
    },
    {
      "format": "none",
      "logBase": 1,
      "max": null,
      "min": null,
      "show": false
    }
  ]
}
@daniellee
Copy link
Contributor

I had a quick look at this and seem to work for me but I haven't tried to recreate the issue with your dashboard json yet.

The decimals field on the axis tab does not control the number of decimal places for legend values. That field is on the legend tab. But it seems to be the same issue for the axis values as well.

@tw-bert
Copy link
Author

tw-bert commented May 3, 2018

Hi @daniellee , thanks for having a look.
The difference is there (see screenshots), but it's not consistently reproducable, as I just found out.
Setting the number of decimals explicitly, on the legend tab (thanks!), works fine for us.
Feel free to close this issue if you don't feel the need trying to reproduce it.

@daniellee
Copy link
Contributor

daniellee commented May 7, 2018

@tw-bert I can reproduce this. It seems to be connected to a change we made to the code that calculates the number of decimal places for the y-axis (this calculation is complicated so it is only wrong sometimes). I added it to the milestone for the next release. Thanks for reporting this!

ref 3cdf0dc#diff-d93fe1310378a95c4a7cd8787b5052fd

@chuski92
Copy link

In my particular case, I was showing ping's ms and found the same problem, but now I need to set legend->values->decimals to 3 to see 3 decimals in tooltip or legend. I upgraded from 4.6 to 5.1 also.
But doing that solves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants