Skip to content
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.

Grafana roundtrip json export/import bug #175

Open
namliz opened this issue Nov 29, 2016 · 2 comments
Open

Grafana roundtrip json export/import bug #175

namliz opened this issue Nov 29, 2016 · 2 comments

Comments

@namliz
Copy link
Contributor

namliz commented Nov 29, 2016

Unfortunately I can reproduce this issue reliably: grafana/grafana#2816

  1. Create dashboard in Grafana 3
  2. Export json file

Import json file manually (via Grafana web UI) works.
Import via API does not despite making the exact same API calls.

In other words, there's some additional json munging required, can't submit dashboard file as-is.
This is an inconvenience because now a hackish post processing step is necessary for demo outputs.

Note: the really odd thing is that backwards compatibility with Grafana 2 is good so dashboards exported from that are imported correctly both ways.

@namliz
Copy link
Contributor Author

namliz commented Nov 29, 2016

This is the dashboard json baked into current kube-grafana container:
https://github.com/cncf/demo/blob/master/Docker/grafana/dashboards/cncfdemo.json

This is how it roundtrips back out if you export it from the UI:
https://gist.github.com/zilman/4fde89c1d07d370e709559bb44274ffa

The diff:

"dashboard" : {
...
    "overwrite" : true,
    "inputs" : [ { 
        "name" : "DS_PROMETHEUS",
        "type" : "datasource",
        "pluginId" : "prometheus",
        "value" : "Prometheus"
    } ]

Without injecting this blob it just fails to import programatically.

@chunxiangli
Copy link

What would be the final solution for this problem. I tried that containerized grafana with baked json in
https://github.com/cncf/demo/blob/master/Docker/grafana/dashboards/cncfdemo.json
That still failed.

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

No branches or pull requests

2 participants