did you get solution for this? if yes, what was the solution?

On Wednesday, 29 August 2018 22:10:27 UTC-5, [email protected] wrote:
>
> I want to extract say, the value of an alert label and put it in the 
> Subject of my mail.
>
> a simpler form of the current setup i have is:
>
> *rules.yml   (Prometheus)*
>
>
> groups:
>
> - name: example
>
>   rules:
>
>   # Alert for any node down for 20s
>
>   - alert: InstanceDown
>
>     expr: up == 0
>
>     for: 20s
>
>     labels:
>
>       severity: 'critical'
>
>       target: 'targetNotifierSystem'
>
>
> and the corresponding alertmanager* settings.yml*
>
>
> ...
> receivers:
> - name: 'target-mail'
>   email_configs:
>   - to: 'target@email'
>     send_resolved: true
>     headers:
>       subject: '[{{ .Labels.severity }}] Test mail subject'
>     html: null
> ...
>  
>
> My aim is to replace .Labels.severity with 'critical'. This setup throws 
> some parsing errors. 
> level=error ts=2018-08-30T02:02:21.178883979Z caller=notify.go:332 
> component=dispatcher msg="Error on notify" err="cancelling notify retry for 
> \"email\" due to unrecoverable error: executing \"Subject\" header 
> template: template: :1:11: executing \"\" at <.Labels.severity>: can't 
> evaluate field Labels in type *template.Data"
>
> using .CommonLabels.severity inserts nothing.
>

-- 
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/41817fec-c521-4c6e-8fc2-101f4d12a594%40googlegroups.com.

Reply via email to