Hello,
I’m trying to configure Grafana alerts with Terraform tool.
I use this blog post as good source of inspiration. There is 1 weird point where you need to specify “model” for an alerting rule.
However the model isn’t documented properly - at least I didn’t find anything.
There was following comment in the blog post:
// `model` is a JSON blob that sends datasource-specific data.
// It's different for every datasource. The alert's query is defined here.
So I did that. However I have one question to it.
My model data for 1 alert stage looks like:
model = jsonencode({
//"conditions" = {
// "evaluator" = {
// "params" = [0, 0]
// "type" = "gt"
// }
// "operator" = {
// "type" = "and"
// }
// "query" = {
// "params" = []
// }
// "reducer" = {
// "params" = []
// "type" = "avg"
// }
// "type" = "query"
//}
//"datasource" = {
// "name" = "Expression"
// "type" = "__expr__"
// "uid" = "__expr__"
//}
"expression" = "A"
"intervalMs" = 1000
"maxDataPoints" = 43200
"reducer" = "last"
"refId" = "B"
"settings" = {
"mode" = "replaceNN"
"replaceWithValue" = 0
}
"type" = "reduce"
})
As you can see above I commented out some portion of the data.
The reason is simple the data look useless in this specific case.
I also tested it without it and the alert seems to work properly.
I didn’t find any documentation for what are these attributes needed.
Is it safe to don’t use commented data?
Is there any documentation to learn more about these attributes?
BR