-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
Unable to share Stackdriver dashboards between Google Projects anymore #23688
Comments
Workaround, I think you can use a template variable for project selection. |
@marefr Thanks for your quick reply. I just tried that and it works, however it leads me to another problem: How do I get the proper project ID into the variables value? I will try to rename the datasource to resemble the project ID and use the variable type "Datasource" to retrieve the name of the stackdriver datasource as a value and use that as a query variable in the panel. |
The solution proposed above isn't feasible because its really confusing to use. shopt -s globstar
for i in $dashboardsDir/**/*.json; do
jq ".panels[]?.targets[]? |= if .projectName then .projectName = \"$googleProjectID\" else . end" "$i" > "$i.tmp"
mv "$i.tmp" "$i"
done I really don't think saving the Google project ID in every stackdriver query is a good idea and I don't understand why this is the way it works now. This also happens in Grafana 7.0.1. |
It looks like there is "Query type : projects" fort this purpose, but it is not working in Grafana 7.0.3 PR #22447 mentions Can somebody confirm this? |
Hi, I am here with more information after a long struggle with exporting and importing of Stackdriver dashboards What I have mentioned in my previous comment (shown on screenshot) is actually issue #25487 What I have found related to this problem is #25373 - it already includes PR, but it will only resolve situations where projectName is not set Just for context if anybody else will come here with problem sharing of Stackdriver Grafana dashboards between two Grafana instances : When I've created dashboard in one Grafana instance, made export and imported into other Grafana instance (different Stackdriver project, bu also provisioned as default datasource), there were errors like So with PR #25413 merged we will still need to something like (not tested) : shopt -s globstar
for i in $dashboardsDir/**/*.json; do
jq ".panels[]?.targets[]? |= if .projectName then del(.projectName) else . end" "$i" > "$i.tmp"
mv "$i.tmp" "$i"
done I agree with @desolatorxxl that saving the Google project ID in every stackdriver query is not good idea. At least, it is breaking our provisioning workflow. |
Hi! For the original issue, template variables can be used to share panels, as mentioned earlier in the thread. In regards to the alerts, we will not be changing that, as we're moving to unified alerting. Unified alerting separates alerts and the dashboards, making it impossible to use template variables. |
In Grafana 6.7.2 it is not possible anymore to trivially share the same dashboards that use a Stackdriver datasource between multiple Grafana instances in different Google Cloud Projects.
When saving the dashboard to JSON, the Google Project will be saved in each panel. Using it via provisioning in another Google Cloud project will result in permission denied errors (which makes sense as it's trying to access the wrong project):
For reference take a look at the
projectName
andlabels
fields in my gist: https://gist.github.com/desolatorxxl/fb45680918c12ab43d5830226ad32b91Currently last known "good" version where this used to work is Grafana 6.4.4.
I believe the issue was introduced by #21002 or #22447.
How to reproduce it (as minimally and precisely as possible):
Grafana in Google Cloud project A:
Grafana in Google Cloud project B:
What you expected to happen:
I would expect the panels to work where the name of the configured datasource matches an existing Stackdriver datasource, as information about the Google Project is already present inside the datasource configuration.
Environment:
The text was updated successfully, but these errors were encountered: