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

Question: How I should export dashboard json #97

Closed
jkroepke opened this issue Feb 4, 2024 · 3 comments · Fixed by #98
Closed

Question: How I should export dashboard json #97

jkroepke opened this issue Feb 4, 2024 · 3 comments · Fixed by #98
Labels

Comments

@jkroepke
Copy link
Contributor

jkroepke commented Feb 4, 2024

Hi,

I'm prepare #79 and I have some trouble to export the JSON file a grafana instance.

If I import a dashboard and export again without any modifications, I get a lot of changes:

For example this commit does not contain any changes, from a lot of changes of JSON level: jkroepke@706315b

Thats how I export the JSON

image

What the recommend way? If the mention approch is the correct one, would it be possible to import and export all dashboard the keep my PR clean as possible? Otherwise, I had tons of non related changes.

@dotdc
Copy link
Owner

dotdc commented Feb 5, 2024

Hi @jkroepke,
Unfortunately, I don't know a way of doing that easily...
I generally use Dashboard settings -> JSON Model, but you'll still need to make some changes:

  • Add back the header for Grafana.com (__inputs, __elements, __requires...)
  • remove id and other instance related fields (if any)
  • Remove any changes to dashboard variables selection (if any)
  • Bump the dashboard version (previous +1)

Please use the latest version of Grafana to edit the dashboards, as API is automatically updated. You'll still see other changes, but they should be fine.

Start with one, and I'll review it to make sure it's fine.

Hope it helps

@dotdc
Copy link
Owner

dotdc commented Feb 5, 2024

You also need to keep

"uid": "${datasource}"

instead of:

"uid": "${DS_PROMETHEUS}"

@dotdc
Copy link
Owner

dotdc commented Apr 25, 2024

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dotdc dotdc added the released label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants