{"action":"closed","issue":{"url":"https://api.github.com/repos/grafana/grafana/issues/6321","repository_url":"https://api.github.com/repos/grafana/grafana","labels_url":"https://api.github.com/repos/grafana/grafana/issues/6321/labels{/name}","comments_url":"https://api.github.com/repos/grafana/grafana/issues/6321/comments","events_url":"https://api.github.com/repos/grafana/grafana/issues/6321/events","html_url":"https://github.com/grafana/grafana/issues/6321","id":183896480,"number":6321,"title":"bug: dashboard post api broken with new \"variables\" for dashboard sharing. can't import metrictank dashboard","user":{"login":"Dieterbe","id":20774,"avatar_url":"https://avatars.githubusercontent.com/u/20774?v=3","gravatar_id":"","url":"https://api.github.com/users/Dieterbe","html_url":"https://github.com/Dieterbe","followers_url":"https://api.github.com/users/Dieterbe/followers","following_url":"https://api.github.com/users/Dieterbe/following{/other_user}","gists_url":"https://api.github.com/users/Dieterbe/gists{/gist_id}","starred_url":"https://api.github.com/users/Dieterbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dieterbe/subscriptions","organizations_url":"https://api.github.com/users/Dieterbe/orgs","repos_url":"https://api.github.com/users/Dieterbe/repos","events_url":"https://api.github.com/users/Dieterbe/events{/privacy}","received_events_url":"https://api.github.com/users/Dieterbe/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-19T08:23:57Z","updated_at":"2016-10-19T08:35:07Z","closed_at":"2016-10-19T08:35:06Z","body":"I upgraded the [raintank devstack](https://github.com/raintank/raintank-docker) to the latest grafana `v4.0.0-pre1 (commit: v3.1.0-1118-g97008f9)` e.g. 97008f90c4dabc11c2ccd9c364c2c9ec180df712\r\n\r\nbut I run into issues when importing the metrictank dashboard, which lives at https://github.com/raintank/raintank-docker/blob/master/docker/grafana/dashboards/metrictank.json\r\n\r\nthis is probably because it now contains some extra metadata for dashboard sharing on grafana.net . in the past it just had a hardcoded `graphite` datasource name, so i could just import it and it would work with the included graphite datasource.\r\n\r\nI import like so:\r\n```\r\n  curl -u admin:admin \\\r\n    -H \"content-type: application/json\" \\\r\n    'http://localhost:3000/api/dashboards/db' -X POST -d \"{\\\"dashboard\\\": $(cat $file)}\"\r\n```\r\nthis used to work fine, but now when I load the dashboard, I get this:\r\n\r\n```\r\nDashboard init failed\r\nTemplate variables could not be initialized: Datasource named ${DS_GRAPHITE} was not found\r\n```\r\ne.g. the dashboard post api does not work well with the variables (that still need values) used by the new export/import mechanism. it just leaves the variablenames which causes breakage.\r\n\r\nMy suggestion is:\r\n1) allow setting values that otherwise have to be choosen in UI dialogs,\r\ne.g. if i could pass -d \"datasource-graphite=graphite\" or something\r\n2) api calls that try to post dashboards but their dependencies are not met or specified, should fail.\r\n\r\n\r\n( when i Import the dashboard through the UI it works fine, i just have to select a graphite datasource.)"}}
{"actor":{"display_login":"torkelo"}}