Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved alert messages with Cortex cluster #351

Merged
merged 1 commit into from
Jul 2, 2021

Conversation

pracucci
Copy link
Collaborator

@pracucci pracucci commented Jul 2, 2021

What this PR does:
We're not using a consistent way to reference a Cortex cluster in alert messages. Sometimes we use the job label, sometimes the namespace other times we don't reference it at all. However, the mixin supports to configure the labels used to "group metrics by cluster" via cluster_labels (or the deprecated alert_aggregation_labels).

In this PR I'm defining alert_aggregation_variables (based on cluster_labels/alert_aggregation_labels) containing the Prometheus templating variables for the labels used to group by cluster and use it in alert messages. For example, the diff for an alert is:

Screenshot 2021-07-02 at 16 39 51

I've checked the whole diff in our infra and should be good.

Which issue(s) this PR fixes:
N/A

Checklist

  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci requested a review from a team as a code owner July 2, 2021 15:01
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 alert_aggregation_variables looks like magic to me.

Were all those % broken before?

@pracucci
Copy link
Collaborator Author

pracucci commented Jul 2, 2021

Were all those % broken before?

No. If you enable the string interpolation in jsonnet then you have to escape % as %%. I've manually checked the compiled output for all messages and should be good 🤞

@pracucci pracucci merged commit b0f9dba into main Jul 2, 2021
@pracucci pracucci deleted the build-alert-messages-based-on-group-labels branch July 2, 2021 15:18
simonswine pushed a commit to grafana/mimir that referenced this pull request Oct 18, 2021
…t-messages-based-on-group-labels

Improved alert messages with Cortex cluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants