Open kiplandiles opened 6 years ago
Looking closer at the code and the resulting output of an alert in OpsGenie I can see in the TICKScript that by default the idVar is sent as the Entity to OpsGenie and also that the Entity is base64 encoded and output as the alias. If using the Chronograf UI to build the TICKScript then by default idVar is defined as name + {{.Group}} and that group is defined by the groupBy variable.
I should be able to modify the idVar variable to include only the proxy and the server (sv) items for HAProxy downtime as an example. With the host removed from the Entity (and alias) the result should be a deduplication.
For example:
var idVar = name + ':proxy={{ index .Tags "proxy" }},sv={{ index .Tags "sv" }}'
Will followup here after testing.
The hack above worked as expected. All of my HAProxy alerts were dedupped by proxy and server and OpsGenie indicated "Alert is received with same alias".
I have a need to use the "alias" field to deduplicate alerts going to OpsGenie. This is especially important for load balanced resources where I may receive 8 separate alerts for a single proxy going down.
I noticed in code that you set the alias ...
alias := base64.URLEncoding.EncodeToString([]byte(entityID))
I think I saw in the same code that EntityID might be an option that I could supply within my TICK script but did not see that in the latest documentation. If EntityID is something I could set myself then I suppose encoding the byte stream would still be OK. I also make use of the Chronograf UI to build my tasks but see nowhere to add EntityID via the UI; however, if that's a valid option then I could just update the TICK script, I suppose.