-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
cannot override "__name__" in google_monitoring_alert_policy, condition_prometheus_query_language block using the labels option. #20938
Comments
As the error message indicates the usage of
You could use any other different
I leave the following OFFICIAL DOCUMENTATION links for more information about this topic:
|
Appreciate the reply, I understand that....and it seems plausable to me that this would be an unsupported operation. Here's the details the rational and source of my confusion. The notification emails that are sent by google include the concept of a metric name. I believe when a PromQL query is used, google get's this name from the So I went looking for a way to get rid of that, or change it to something meaningful. I came across this section of the documentation that you linked to (https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/monitoring_alert_policy#labels-1)
OK so in the actual text, name is bolded, which makes me think that this is a markdown typo for Except it doesn't work. Totally fine if you want to close this or switch it to enhancment or doc update. But it seems like something is missing here to me. Thanks! |
Sure @nick-lawrence, I'm forwarding this issue to evaluate if it is possible this kind of enhancement |
Community Note
Terraform Version & Provider Version(s)
Terraform v1.9.8
on linux_amd64
Affected Resource(s)
google_monitoring_alert_policy
within that resource condition_prometheus_query_language
Terraform Configuration
This a cut and paste of my partial configuration. The labels doesn't let me set "
__name__
", the documentation implies that I should be able to set it. I want to be able to set it so that google incident notifications include a metric name for complex queries where 'name' is removed from the query.Debug Output
No response
Expected Behavior
Intending to override/set the "
__name__
" label for my query.The reason is when goggle sends me a notification email, it includes a
metric : missing
label.
I believe that 'metric' is the "
__name__
" from the query, because my query is complex, the label is not in the result, and thus it's reported as missing.I'd like to set that to avoid confusion when reading the notification.
Documentation implies that I should be able to do this:
Actual Behavior
Apply fails with:
"
__name__
": PromQL names beginning with __ are reserved for internal use.Steps to reproduce
terraform apply
Important Factoids
I tried using "name", but this just created another label. Same thing with "metric" which is how google displays this.
It seems like "name" should be allowed, but is being blocked.
References
No response
The text was updated successfully, but these errors were encountered: