Hi All,
We are using templates to refine the parameters going to the slack channel
from alertmanager, we do have one api to which we are sending alert
notifications but while using same templates for api, reloading the
alertmanager.yml gives error " field title not found in type config.plain".
I have rechecked if there is any indentation error in yaml file. Please
suggest whether it is possible for api or not. If yes , please guide me
towards it.
Template file :-
{{ define "webhook.default.title" }}{{ template "__subject" . }}{{ end }}
{{ define "webhook.default.username" }}{{ template "__alertmanager" . }}{{
end }}
{{ define "webhook.default.fallback" }}{{ template "webhook.default.title"
. }} | {{ template "webhook.default.titlelink" . }}{{ end }}
{{ define "webhook.default.pretext" }}{{ end }}
{{ define "webhook.default.titlelink" }}{{ template "__alertmanagerURL" .
}}{{ end }}
{{ define "webhook.default.iconemoji" }}{{ end }}
{{ define "webhook.default.iconurl" }}{{ end }}
{{ define "webhook.default.text" }}{{ end }}
{{ define "webhook.default.footer" }}{{ end }}
Alertmanager.yml file :-
- name: "en_api"
webhook_configs:
- url: http://dticket.xxxxxxx.com/prometheus_api.php
title: '{{ template "webhook.default.title" . }}'
text: |-
{{ range .Alerts }}
*ALERT:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
*DESCRIPTION:* {{ .Annotations.description }}
{{ .Annotations.identifier }}
{{ end }}
Thanks in Advance
--
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/c01b22eb-828d-4df2-bcea-f6e448ab2ca5%40googlegroups.com.