Open IRus opened 5 years ago
Export of JSON from stackdriver policy details page
{
"combiner": "OR",
"conditions": [
{
"conditionRate": {
"aggregations": [
{
"alignmentPeriod": "60s",
"crossSeriesReducer": "REDUCE_SUM",
"perSeriesAligner": "ALIGN_MEAN"
}
],
"comparison": "COMPARISON_GT",
"filter": "metric.type=\"custom.googleapis.com/my/endpoint/http/fallback\" resource.type=\"global\"",
"thresholdValue": 5,
"timeWindow": "300s",
"trigger": {
"count": 1
}
},
"displayName": "Fallback calls count"
}
],
"displayName": "My Endpoint",
"enabled": true,
"notificationChannels": [...]
}
I did not look too much into detail but it seems that we also need a condition_rate
here (see line 5 in the JSON posted in the previous comment)?
However, the official API documentation does neither cover timeWindow
nor conditionRate
at time of writing. Maybe this is because google flags the alert policy API as "beta" and does not support rate conditions officially at the moment?
b/262484991
I've looked into this issue and the following are the details that I have found out:
time_window
field in the google_monitoring_alert_policy
resource.conditionRate
and it contains the timeWindow
field.conditionRate
seems not to be supported by the API and it supports only four types of conditions.Hence, Adding the support for these fields in the terraform requires the API to support these fields as well.
Community Note
Description
I'd like to specify Metric rate (percent) of change condition for alert policy with tf
New or Affected Resource(s)
Potential Terraform Configuration