-
Notifications
You must be signed in to change notification settings - Fork 16
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
Alertmanager Integration #129
Conversation
This commit introduces a Loki tester charm for the purpose of integration testing the Loki charm. The loki tester charm forwards its own Python debug logs to Loki, when a Juju relation is created between it and the Loki charm. Normally the tester charm only forwards Python debug logs to Loki. The tester charm also provides and Juju action "log-error" which logs and error message to loki. The tester charm contains an alert rule which is also forwarded to Loki. This alert rule triggers an alert any time an error log is received by Loki.
This commit adds an integration test to check that LokiPushApiConsumer can forward logs and alert rules to LokiPushApiProvider. The test further checks conditions satisfying the alert rules do indeed raise alerts.
Libraries are not up to date with their remote counterparts. If this was stdout
stderr
|
Libraries are not up to date with their remote counterparts. If this was stdout
stderr
|
Add a helper method to also check the Prometheus-compatible alerts endpoint from Loki itself, so we can check there as a bisection point between Alertmanager. Add a test which exercises this endpoint. Typos and cleanup. Add a (very temporary) FIXME so the "other" test which uses Alertmananager can be moved to the bundle when this merges
Libraries are not up to date with their remote counterparts. If this was stdout
stderr
|
Libraries are not up to date with their remote counterparts. If this was stdout
stderr
|
Issue
Implement integration between Alertmanager and Loki, so any alerting rules actually fire alerts.
Solution
Primarily this was simply additions to
metadata.yaml
and small changes to the charm. The bulk of it was the creation of a workload-less tester charm which can generate messages in an arbitrary format through Juju actions.Testing Instructions
Deploy Loki and Alertmanager, as well as some charm which includes alerting rules (or
cos-config
with rules which match). See if alerts fire.Release Notes
Integrate Loki and Alertmanager, so that alerts fired by Loki based on LogQL alert rules are sent to Alertmanager for routing.