Update cos_agent lib with generic HostHealth rules #232
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Currently, the grafana-agent host health rules are hard-coded in a .rule file. Once the tandem PR is merged, the UX will differ between vm and k8s charms.
Solution
Match the same UX of k8s charms by injecting the alert rules on the fly in the cos_agent Provider. Remove the host_health .rule file to avoid collisions and dedupe conflicts.
Context
In tandem with:
Testing Instructions
cos_agent
In a microk8s controller:
curl -L https://raw.githubusercontent.com/canonical/cos-lite-bundle/main/overlays/offers-overlay.yaml -O juju deploy cos-lite --trust --overlay ./offers-overlay.yaml
In a lxd controller:
juju ssh zookeeper/0 "sudo snap stop charmed-zookeeper"
HostDown
alert to firejuju ssh zookeeper/0 "sudo snap stop grafana-agent"
HostMetricsMissing
alert to firecos-proxy
Upgrade Notes
By fetching the new libs you would get a set of new alerts automatically. If charms already had up/absent alerts, this will result in duplication of alerts and rules.
up
/absent
alerts are ubiquitous and are handled by the libs modified in this PR. Any custom alerts duplicating this behaviour can be removed.