Skip to content

Filtering active silences via API does not work as expected #2928

@oalimerko

Description

@oalimerko

What did you do?

I ran this API call for filtering all active silences in Alertmanager with severity="high" ,severity="high" is a match label

http://127.0.0.1:9093/api/v2/silences?silenced=false&active=true&filter=severity="high"

What did you expect to see?

I expect to see only silences with severity="high" which are active.I can get this via amtool

What did you see instead? Under which circumstances?
I can see the whole silences ,active and expired ,with severity="high"

Environment
Win 10

  • System information:

MSYS_NT-10.0-19044 3.3.3-341.x86_64 x86_64

  • Alertmanager version:

alertmanager-0.21.0.windows

  • Prometheus version:

Prometheus is not used.Only a dummy AM instance for testing purpose,all alerts are created manually in AM via amtool

  • Alertmanager configuration file:
global:
  resolve_timeout: 5m

route:
  group_by: ['alertname']
  group_wait: 10s
  group_interval: 10s
  repeat_interval: 1h
  receiver: 'web.hook'
receivers:
- name: 'web.hook'
  webhook_configs:
  - url: 'http://127.0.0.1:5001/'
inhibit_rules:
  - source_match:
      severity: 'critical'
    target_match:
      severity: 'warning'
    equal: ['alertname', 'dev', 'instance']

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions