alertmanager icon indicating copy to clipboard operation
alertmanager copied to clipboard

opsgenie: Add visible_to

Open chlunde opened this issue 1 year ago • 1 comments

Add visible_to with the same support for templating and fields as the existing responders field.

Opsgenie documentation:

Teams and users that the alert will become visible to without sending any notification. type field is mandatory for each item, where possible values are team and user. In addition to the type field, either id or name should be given for teams and either id or username should be given for users. Please note: that alert will be visible to the teams that are specified within responders field by default, so there is no need to re-specify them within visibleTo field. You can refer below for example values.

The functionality has been tested with unit tests, and with the following configuration:

  route:
    receiver: og
    group_wait: 30s
    group_interval: 5m
    repeat_interval: 12h
  receivers:
  - name: og
    opsgenie_configs:
    - send_resolved: true
      api_key: ...top secret...
      api_url: https://api.eu.opsgenie.com/
      message: 'Lab message'
      description: 'Static description'
      source: lab
      details:
        foo: bar
      priority: P4
      visible_to:
      - type: user
        username: [email protected]

Fixes #3953

chlunde avatar Aug 15 '24 13:08 chlunde

@grobinson-grafana Could you take another look? Or should we involve the authors of the original code? Alternatively I could make a stripped down version of the PR but that would make this field behave differently from receivers

chlunde avatar Oct 08 '24 06:10 chlunde