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

Random data displayed in Grafana dashboard after import #69

Closed
hatifnatt opened this issue Oct 30, 2019 · 4 comments · Fixed by #71
Closed

Random data displayed in Grafana dashboard after import #69

hatifnatt opened this issue Oct 30, 2019 · 4 comments · Fixed by #71
Assignees

Comments

@hatifnatt
Copy link

After importing dashboard all panels of the dashboard is filled with "Test data: random walk" and Query is "default" not Prometheus as selected during import. Some more details can be found here.

Steps to reproduce the behavior:

  1. Import dashboard with one of the latest version of Grafana (I'm using 6.4.3)
  2. See all panels are filled with random data.

Expected behavior
Panels displaying actual data, datasource is correctly set.

Environment

  • NGINX Prometheus Exporter Version=0.4.2 GitCommit=f017367
  • Grafana 6.4.3
  • NGINX

Additional context
I suppose problem can be fixed by re-exporting dashboard with Grafana 6.4+. Or by manually adding "datasource": "${DS_PROMETHEUS}", into each panel in JSON data, this is how I fixed it for myself.

@hatifnatt hatifnatt changed the title Update Grafana dashboard to fix import problem Random data displayed in Grafana dashboard after import Oct 30, 2019
@Rulox Rulox self-assigned this Oct 31, 2019
@Rulox
Copy link

Rulox commented Oct 31, 2019

Hi @hatifnatt

Thanks for the report! I wasn't able to exactly reproduce this, so in order to really fix the problem could you provide me the following info? Thanks.

  • Prometheus version
  • Do you have any other data sources in your Grafana instance?
  • Do you have any other dashboards?
  • Could you let me know exactly the steps you followed? (for example: 1: click on Import Dashboard, 2 paste the JSON and select the Prometheus datasource, 3 click on Import..)

Thanks !

@hatifnatt
Copy link
Author

  • Prometheus version 2.13.1
  • Yes I have other data sources
  • Yes I have other dashboards

Steps to reproduce

  • Download dashboard as file from https://raw.githubusercontent.com/nginxinc/nginx-prometheus-exporter/master/grafana/dashboard.json
  • Go to Grafana hover '+' symbol in top left side
  • Click on 'Import'
  • Click on 'Upload .json file'
  • Select file via OS filepicker
  • Change name and uid if you already have this dashboard in Grafana
  • Select Prometheus source, I have only one Prometheus source named 'Prometheus' so I select it. But my Prometheus data source is not selected as default.
    dashboard creation process
  • Click 'Import' button
  • Resulting dashboard looks like this
    resulting dashboard
  • Note for 'Query' (data source) 'default' is selected and for individual A, B queries Test data: random walk is used.
    editing panel

I made a test. If I mark 'Prometheus' data source as 'default' in data source parameters dashboard start to work as expected. I think that's why you probably can't reproduce this issue.
Prometheus is default data source

@Rulox
Copy link

Rulox commented Nov 1, 2019

Ah it makes sense,

I think it has to do with the default Datasource you are right. We'll have a look at all of this and get back to you soon with the fix.

Thank you so much for the detailed explanation !!

@saltbo
Copy link

saltbo commented Mar 10, 2022

https://github.com/nginxinc/nginx-prometheus-exporter/pull/71/files

replace the json field "datasource": null to "datasource": "${DS_PROMETHEUS}" worked for me

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

Successfully merging a pull request may close this issue.

3 participants