alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

Visualization fails to execute match_re correctly

Open iksaif opened this issue 9 years ago • 9 comments

lib/routing-tree.js doesn't seem to handle match_re properly. I defined a set of routes, and the route with match_re always seem to match everything.

My rule looks like "severity = page|interrupts" but will match alerts that don't even have a severity

When I hover the node, the text is "severity=/[object Object]/"

iksaif avatar Feb 15 '17 10:02 iksaif

Going to api/v1/status I get:

"match_re": {
"severity": {}
}

That would explain things

iksaif avatar Feb 15 '17 11:02 iksaif

I guess regex objects are not being marshalled properly in json.

iksaif avatar Feb 15 '17 11:02 iksaif

I'm running into this same issue. Did you find a workaround?

bspradling avatar Apr 20 '17 23:04 bspradling

What version are you using? Seems this was fixed in january: https://github.com/prometheus/alertmanager/commit/f2ba86e9d204fbc08dca34940a353d61f7564987

We haven't had a release since then, unfortunately, but if you build from master it should be fine.

stuartnelson3 avatar Apr 21 '17 08:04 stuartnelson3

Interesting, I checked to see that I'm running the latest, the docker container is prom/alertmanager:v0.5.1.

My routes are here:

 routes:
  - match_re:
       job: dev
    receiver: {team}-dev-receiver

All the online helpers with tree routing seem to get this right when I copy my configuration in, it is just when the alertmanager is actually running, I never see my {team}-dev-receiver matching.

I also went here /api/v1/status and saw the same thing:

  "match_re": {
       "job": {}
    }

bspradling avatar Apr 21 '17 14:04 bspradling

Yeah, 0.5.1 was released before this fix. You'll have to build from a later SHA to get the fix.

stuartnelson3 avatar Apr 23 '17 12:04 stuartnelson3

@stuartnelson3 it looks like the above mentioned PR was merged into the v0.6 release as well as master, but I'm still experiencing routing visualization issues when using those releases.

I'm using alertmanager (version=0.6.1, branch=release-0.6, revision=5aeaf2cb988b0094b7998bbe6568bba23a0eb9c2) and the following test config:

route:
  receiver: ops-nag
  routes:
  - match_re:
      service: apache|nginx
      severity: page
    receiver: web-page
  - match_re:
      service: apache|nginx
    receiver: web-nag
  - match:
      severity: page
    receiver: ops-page
receivers:
- name: ops-nag
- name: ops-page
- name: web-nag
- name: web-page

When I use a label set of {service="hbase"} I would expect the page to go to ops-nag (the parent default), but the visualization tool shows it going to web-page:

error-on-v0 6

and a more detailed view of the routing with the mouse over error:

close-up-error-on-v0 6

FWIW I also tried this on the current master as well (version=0.6.1, branch=master, revision=8566c9531b1107bc243d3cba7173406e39f7771d) and had the same result. I also tried this with a variety of other label sets with similarly incorrect and confusing results (e.g. {service="lol"} goes to web-page not ops-nag, but {service="asdf"} as expected goes to ops-nag ¯_(ツ)_/¯).

I have verified that the underlying system is routing as I would expect the pages to be sent, so like the other people having this issue it doesn't seem to be from the underlying matching. Given this it seems to be the same behavior as described above, so I'm not sure the issue has been resolved.

MrAlias avatar May 04 '17 00:05 MrAlias

I'm having this exact same problem in v0.6.1.

snarlysodboxer avatar May 04 '17 01:05 snarlysodboxer

It looks like this resolved this issue for me.

FWIW it also looks like this change was merged into release-0.6 (which is also working now).

MrAlias avatar May 10 '17 16:05 MrAlias