Skip to content

Allow regex to keep for promql/aggregate #509

Description

@leagueofsoups

Hey! Can you please allow regex to be used for "keep"? My prometheus uses a webhook to send alerts to corporate monitoring, it expects to receive alerts with at least one label from the set.

For example:

rule {
  match {
    kind = "alerting"
  }

  aggregate ".+" {
    keep = ["lable1|lable2"]
  }
}

more information:

Is there a way to check label by regex in the resulting vector, like promql/series (api request)? (after aggregating and adding additional labels)

I whant find alerts WITHOUT special_label

#situation 1:

- name: "<name>"
  rules:
  - alert: AlertName
    expr: <aggregate expression>
    labels:
      special_label: ...

#situation 2:

- name: "<name>"
  rules:
  - alert: AlertName
    expr: sum by (special_label)...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions