thanos icon indicating copy to clipboard operation
thanos copied to clipboard

mixin: align alert annotations with alert dimensions

Open simonpasquier opened this issue 3 years ago • 0 comments

Changes

While users can customize the dimensions on which the alert expression operates, the annotation fields were hardcoded with the default dimensions. This change reflects the actual dimensions in the 'description' annotation automatically so users don't have to patch manually.

Example of the current issue: https://github.com/openshift/cluster-monitoring-operator/blob/0a8b4f1524dda9de32006e708f53cdac9fe295d5/assets/prometheus-k8s/prometheus-rule-thanos-sidecar.yaml#L18-L27

The expression is sum by (namespace, job, instance) (...) > 0 while the description (Thanos Sidecar {{$labels.instance}} in {{$labels.namespace}}) doesn't display the job label (and the namespace label is only there because it's given in the targetGroups argument).

Signed-off-by: Simon Pasquier [email protected]

  • [X] I added CHANGELOG entry for this change.
  • [ ] Change is not relevant to the end user.

Verification

I'm planning on testing it with github.com/prometheus-operator/kube-prometheus for the sidecar and query alerts.

simonpasquier avatar Aug 11 '22 08:08 simonpasquier