On Monday, 27 February 2023 at 13:22:04 UTC Sampada Thorat wrote:

Hello Brian I tried your change yet my alertmanager isn't taking config 
changes and shows older config. Can u have a look ?


You mentioned ConfigMap, which suggests that you are deploying Prometheus 
on a Kubernetes cluster.  It looks like your problem is primarily with 
Kubernetes, not Prometheus.

If you deployed Prometheus using one of the various third-party Helm 
charts, then you could ask on the tracker for that Helm chart.  They might 
be able to tell you how it's supposed to work if you change the ConfigMap, 
e.g. whether you're supposed to destroy and recreate the pod manually to 
pick up the change.

Alternatively, it might be that your config has errors in it, and 
Alertmanager is sticking with the old config.

I tested the config you posted, by writing it to tmp.yaml and then running 
a standalone instance of alertmanager by hand:

/opt/alertmanager/alertmanager  --config.file tmp.yaml 
 --web.listen-address=:19093 --cluster.listen-address="0.0.0.0:19094"

It gave me the following error:

ts=2023-02-27T14:56:01.186Z caller=coordinator.go:118 level=error 
component=configuration msg="Loading configuration file failed" 
file=tmp.yaml err="yaml: unmarshal errors:\n  line 22: cannot unmarshal 
!!str `alertna...` into []string\n  *line 23: field receiver already set* 
in type config.plain"

(I would expect such errors to appear in pod logs too)

It's complaining that you have duplicate values for the same "receiver" key:

route:
  ...
  *receiver:* default_receiver_test
  ...
  *receiver:* pdmso_alerts

This is because you did not indent the second 'receiver:' correctly.  It 
has to be under the bullet point for the 'routes:'

route:
  receiver: default_receiver_test
  routes:
  - matchers:
      - 
alertname=~"HostOutOfDiskSpace|HostHighCpuLoad|HostHighCpuLoad|KubeNodeNotReady"
*      ^ dash required here because 'matchers' is a list*
    *receiver: pdmso_alerts*
*    ^ should be here, to line up with "matchers" as it's part of the same 
route (list element under "routes")*


-- 
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/a183d004-896c-4f7c-88d1-7bed759b1f49n%40googlegroups.com.

Reply via email to