Hi all, I'm having trouble with an alert description that relates to a 
failure % of our SMS service Twilio. When the alert fires the description 
currently 
looks like below-

"25.00% of Twilio SMS attempts have failed in the last 5 minutes"

However, we want to include the volume of attempts that come in during the 
5 minute period as well, so we want it to look like below-

"25.00% Twilio SMS attempts have failed in the last 5 minutes
Total SMS attempts: 8"

I believe this is possible to configure in alertmanager, however I have 
been having lots of trouble with this so I am hoping that someone here can 
help. It seems that this person in this forum 
<https://github.com/prometheus/alertmanager/issues/549#issuecomment-260585592> 
is 
attempting something similar, and I have tried similar descriptions but 
both error in the description.


   - *description: '{{ $value | printf "%.2f" }}% of Twilio SMS 
   attempts have failed in the last 5 minutes from API \n Total SMS attempts: 
{{ printf 
"(sum(rate(twilio_text_requests_seconds_count{application=\"api\"}[5m]))) * 
300" | query |humanize }}'*
   - 
*description: '{{ $value | printf "%.2f" }}% of Twilio SMS 
   attempts have failed in the last 5 minutes from API \n Total SMS attempts: 
{{ with query 
"(sum(rate(twilio_text_requests_seconds_count{application='api'}[5m]))) 
   * 300" }} {{ . | first | value | humanize }} {{ end }}' *

Errors for above attempts:

   - <error expanding template: error executing template 
   __alert_TwilioFailure: template: __alert_TwilioFailure:1:341: executing 
   "__alert_TwilioFailure" at <humanize>: error calling humanize: can't 
   convert template.queryResult to float>
   

If anyone can point me in the right direction for query template functions 
or post a solution it would be very much appreciated!

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/1ce6400b-4d41-4278-84a0-7b9f7a077a4en%40googlegroups.com.

Reply via email to