Hi,

The YAML syntax for that details portion should be:

details:
  mykey1: myvalue1
  mykey2: myvalue2

...and the default value (as indicated by your config docs snippet) would
be fully written out like this:

details:
  resolved:     '{{ template "pagerduty.default.instances" .Alerts.Resolved
}}'
  num_firing:   '{{ .Alerts.Firing | len }}'
  num_resolved: '{{ .Alerts.Resolved | len }}'

The docs just use a more JSON-style syntax since JSON is also a valid
subset of YAML, so you could use { ... } JSON object notation as well.

Each of the values is a templateable string (as shown in the default
value), so you can use variables and template functions in there to refer
to e.g. alert labels and such.

Regards,
Julius

On Tue, Nov 15, 2022 at 7:58 AM David Heinz <[email protected]> wrote:

> Would anyone happen to have a sample Alertmanager.yml that includes the
> arbitrary key values here:
>
> [ details: { <string>: <tmpl_string>, ... } | default = {
>   firing:       '{{ template "pagerduty.default.instances" .Alerts.Firing
> }}'
>   resolved:     '{{ template "pagerduty.default.instances"
> .Alerts.Resolved }}'
>   num_firing:   '{{ .Alerts.Firing | len }}'
>   num_resolved: '{{ .Alerts.Resolved | len }}'
> }
> https://prometheus.io/docs/alerting/latest/configuration/#pagerduty_config
>
> I need to add a nodename value in this section, but can't seem to get the
> yaml right,  I would greatly appreciate any help at all.
>
> --
> 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/8b547c88-0bf5-4994-bb03-e27822deea78n%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/8b547c88-0bf5-4994-bb03-e27822deea78n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Julius Volz
PromLabs - promlabs.com

-- 
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/CAObpH5x-4i%2BoXBBLh_uD9%2BU%3DGiZPpLsC84JMv0sfb2zw_xsF%3Dw%40mail.gmail.com.

Reply via email to