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

Add CI and unit tests for prometheus rules using promtool #505

Merged
merged 6 commits into from
Dec 18, 2024

Conversation

gabrielcocenza
Copy link
Member

@gabrielcocenza gabrielcocenza commented Nov 14, 2024

  • It's good to have unit tests for the prometheus alerts and also check if the prometheus_alerts.yaml is a valid file.

  • using promtool is possible to check the rules and also run unit tests.

How to test this PR

  1. Install the prometheus snap:
sudo snap install prometheus
  1. Run to check if the rules file is valid:
promtool check rules src/alert_rules/prometheus/*.yaml
  1. Run the unit tests:
promtool test rules tests/unit/test_alert_rules/*.yaml

- It's good to have unit tests for the prometheus alerts and also
  check if the prometheus_alerts.yaml is a valid file.

- using promtool is possible to check the rules and also run unit
  tests for the alerts.
@gabrielcocenza gabrielcocenza marked this pull request as ready for review November 19, 2024 13:22
@gabrielcocenza gabrielcocenza self-assigned this Dec 10, 2024
Copy link
Contributor

@zmraul zmraul left a comment

Choose a reason for hiding this comment

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

@gabrielcocenza gabrielcocenza merged commit 78c448a into canonical:2/edge Dec 18, 2024
36 of 42 checks passed
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