0

I have the following two alerts:

alert: InstanceDown
expr: (up == 0) and (team == "foo")
for: 5m
labels:
  severity: page
  team: foo
annotations:
  summary: "Instance {{$labels.instance}} down"

alert: InstanceDown
expr: (up == 0) and (team == "bar")
for: 5m
labels:
  severity: page
  team: bar
annotations:
  summary: "Instance {{$labels.instance}} down"

How can I make Prometheus to send the first alert into one alertmanager exposed at alertmanager.example.com/team-foo and second into another alertmanager exposed at alertmanager.example.com/team-bar?

I figured I'll need to use service discovery and relabeling but couldn't get much further yet.

I'm using prometheus-operator if it matters.

Maklaus
  • 538
  • 2
  • 16
  • 37

1 Answers1

2

I don't think you can filter which alerts go to which Alertmanager. You can however send all alerts to 2 (or N) Alertmanager instances and have each Alertmanager configured to route some alerts and ignore all others (i.e. route them to a named receiver with no email, no Slack, no nothing).

Alin Sînpălean
  • 8,774
  • 1
  • 25
  • 29
  • Thanks it solves the first part of the problem - allowing teams to configure routes independently from each other. It doesn't help with authorizing access to only their metrics since in Alertmanager UIs all the alerts are going to be displayed. – Maklaus May 15 '19 at 14:48