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

Implement handling of Alertmanager config #180

Merged
merged 52 commits into from
Dec 16, 2024
Merged

Conversation

TheoBrigitte
Copy link
Member

@TheoBrigitte TheoBrigitte commented Dec 5, 2024

Towards: giantswarm/roadmap#3747

This PR implements the Alertmanager resources/job used to load the configuration from the secret (see #188) into Mimir's Alertmanager using Mimir's Alertmanager API.

Here is how it works:

  • Read informations from the secret, using alertmanager.yaml key for the main configuration and any .tmpl key for templates
  • Set each template name in the alertmanager config
  • Compile the request
  • Send a POST /api/v1/alerts request
  • Handle any non 201 status code as error
  • Et voila

Note:

  • +414 changes in go.sum, that's because of github.com/prometheus/alertmanager/config import needed to load and mangle the alertmanager configuration

@TheoBrigitte TheoBrigitte changed the title Add alertmanager config handling Implement handling of Alertmanager config Dec 10, 2024
TheoBrigitte and others added 8 commits December 10, 2024 18:48
- Add secret resource, embedding raw and templated alertmanager files
- Expose alertmanager templates values as helm chart values
- Remove all Mimir related conditions
- Split template into url and notification templates
- Drop template directive, dynamically set by the operator
- Escape template in template
- Re-use slack actions
This fixes the infamous: error calling tpl: cannot retrieve Template.Basepath from values inside tpl function

It does use .Values in templates to access values and pass $ root context to tpl
Co-authored-by: Quentin Bisson <[email protected]>
@TheoBrigitte TheoBrigitte changed the base branch from main to alertmanager-config-helm December 15, 2024 17:20
main.go Show resolved Hide resolved
@TheoBrigitte TheoBrigitte changed the base branch from alertmanager-config-helm to main December 15, 2024 18:08
@TheoBrigitte TheoBrigitte marked this pull request as ready for review December 15, 2024 18:50
@TheoBrigitte TheoBrigitte requested a review from a team as a code owner December 15, 2024 18:50
@TheoBrigitte TheoBrigitte merged commit fbfd0f1 into main Dec 16, 2024
10 checks passed
@TheoBrigitte TheoBrigitte deleted the alertmanager-config branch December 16, 2024 15:03
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.

3 participants