You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
If an issue is assigned to a user, that user is claiming responsibility for the issue.
Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.
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.
resource"google_monitoring_alert_policy""promql_policies" {
project=var.project_idfor_each={ fori, policyinlocal.policies["promql_policies"] :i=>policy }
display_name=each.value["display_name"]
combiner=each.value["combiner"]
dynamic"conditions" {
for_each={ fori, conditionineach.value["conditions"] :i=>condition }
content {
display_name=conditions.value["display_name"]
condition_prometheus_query_language {
query=conditions.value["query"]
duration=conditions.value["duration"]
disable_metric_validation=true# >>>>>>> This is the important part# >>>>>>> Overriding "__name__" causes the apply to faillabels={ "__name__" = conditions.value["metric_name"] }
}
}
}
severity=each.value["severity"]
enabled=each.value["enabled"]
documentation {
subject="${each.value["documentation"]["subject"]} (${var.project_id})"mime_type="text/markdown"content=each.value["documentation"]["content"]
}
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:
labels - (Optional) Labels to add to or overwrite in the PromQL query result. Label names must be valid. Label values can be templatized by using variables. The only available variable names are the names of the labels in the PromQL result, including "name" and "value". "labels" may be empty. This field is intended to be used for organizing and identifying the AlertPolicy
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:
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: