Hello :wave: Im trying to create a `AlertmanagerC...
# general
b
Hello πŸ‘‹ Im trying to create a
AlertmanagerConfig
for use in the Monitoring V2 App but hitting a bit of a problem, hopefully someone can come to the rescue πŸ™‚ I have a config that look something like this:
Copy code
apiVersion: <http://monitoring.coreos.com/v1alpha1|monitoring.coreos.com/v1alpha1>
kind: AlertmanagerConfig
metadata:
  name: alertmanager-config
spec:
  receivers:
    - name: cloudops
      pagerdutyConfigs:
        - httpConfig: {}
          routingKey:
            key: routing-key
            name: pagerduty-routing-key
          sendResolved: true
    - name: opt
      slackConfigs:
        - apiURL:
            key: slack-webhook
            name: slack-webhook
          channel: '#...'
          httpConfig: {}
          sendResolved: true
          text: '{{ template "slack.rancher.text" . }}'
    - name: sws
      slackConfigs:
        - apiURL:
            key: slack-webhook
            name: slack-webhook
          channel: '#...'
          httpConfig: {}
          sendResolved: true
          text: '{{ template "slack.rancher.text" . }}'
  route:
    groupBy:
      - job
    groupInterval: 1m
    groupWait: 30s
    receiver: cloudops
    routes:
      - matchers:
          - name: namespace
            regex: true
            value: foo|bar
        receiver: sws
      - matchers:
          - name: namespace
            value: foo-prod
        receiver: opt
Which in turn results in this Routing tree:
Copy code
/alertmanager $ amtool --alertmanager.url=<http://localhost:9093> config routes show
Routing tree:
.
└── default-route  receiver: null
    β”œβ”€β”€ {namespace="cattle-monitoring-system"}  continue: true  receiver: cattle-monitoring-system-alertmanager-config-cloudops
    β”‚   β”œβ”€β”€ {namespace=~"^(?:foo|bar)$"}  receiver: cattle-monitoring-system-alertmanager-config-sws
    β”‚   └── {namespace="foo-prod"}  receiver: cattle-monitoring-system-alertmanager-config-opt
    └── {alertname="Watchdog"}  receiver: null
It seems the
spec.route.receiver
is ignored and moved under the default-route node, and the other 2 routes becomes a child of that node which means i can't get the matching to act as expected:
Copy code
/alertmanager $ amtool --alertmanager.url=<http://localhost:9093> config routes test namespace=foo-prod
null
141 Views