-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Alert provisioning does not support using Environment Variables #54984
Comments
Thanks for creating this issue, @JamesGibo this sounds similar to the issue fixed by this PR. Perhaps helpful? |
Same issue here with Grafana v9.1.4 @zuchka sorry but I don't think this issue is related to the one you mentioned. @JamesGibo I have issues loading notification policies through provisioning, do you? |
I have managed to load notification polices OK through provisioning, but the alert provisioning documentation is lacking some key information and clear examples, I have had to look at the code a number of times. |
@zuchka I don't think this issue is related, this PR bypasses interpolation for query data for alerting rules, where I have seen the issue is configuring the contact point not the rules, these are 2 separate files. Interestingly the alert rules file does interpolate other fields meaning I had to escape the # <duration, required> for how long should the alert fire before alerting
for: 60s
# <map<string, string>> a map of strings to pass around any data
annotations:
summary: "High CPU usage {{ $$labels.host }}"
description: "Average CPU usage for host {{ $$labels.host }} is above 60%"
# <map<string, string> a map of strings that can be used to filter and
# route alerts
labels:
severity: Warning |
@JamesGibo can you please paste here an example of notification policies yaml file? |
I only have a single notification policy so have not tested multiple I am afraid. |
@JamesGibo ok no worries, but I have also another issue. Once the single notification policy is provisioned, then I'm not able to create other policies in Grafana UI. This sounds really weird... or am I missing something? |
I would create a new issue for this as it is not related to the current issue, but i see the same. |
@JamesGibo just wanted to check with you. |
Issue is still present in Grafana v9.1.5 |
As alerting system is made of different components (contact points, templates, notification policies and alert rules) it would be really nice and important to check that each of them supports environment variables during provisioning. |
Issue is still present in Grafana v9.1.6 |
Thanks for creating this issue, an engineer at Grafana Labs will look at this bug during the upcoming week. |
This will be fixed in 9.1.7 and 9.2.X |
Suppose this work when calling provisioning API directly, i.e. Terraform? Seems not. We are running 9.2.0 |
What happened:
When provisioning a slack alerting contact point, using an environment variable to set the URL, the provisioning template does not expand the environment variable. The same process works fine for other config files like when setting the URL for a Datasource.
https://grafana.com/docs/grafana/latest/administration/provisioning/#contact-points
https://grafana.com/docs/grafana/latest/administration/provisioning/#using-environment-variables
What you expected to happen:
The provisioning template should expand the environment variable in alerting provisioning.
How to reproduce it (as minimally and precisely as possible):
Use the following configuration file and reload grafana
Anything else we need to know?:
Environment:
The text was updated successfully, but these errors were encountered: