canonical / canonical/cos-proxy-operator
Respect `forward_alert_rules` config option in cos-agent
- Dominant language
- Python
- Stars
- 3
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Description
### Bug Description
Cos-proxy has a `forward_alert_rules` config option to conditionally forward alert rules downstream. Cos-agent does not respect this and always sends loki alert rules to databag:
- https://github.com/canonical/cos-proxy-operator/blob/cf9fabb3b2f1457af2989b8a09c407cee44b1d09/lib/charms/grafana_agent/v0/cos_agent.py#L679
This is also true for metric alert rules
### To Reproduce
`juju config cos-proxy forward_alert_rules=false`
Check that there are no alert rules in the databag for `cos-agent` in a deployment:
### Environment
To test for metrics alert rules, you can deploy this:
```
nrpe --- cos-proxy --- opentelemetry-collector
```
I am not aware of any charms which have bundled Loki alert rules, so you would have to add some to a charm and pack/deploy it.
### Relevant log output
```shell
n/a
```
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in lib/charms/grafana_agent/v0/cos_agent.py around line 679 and trace how Loki and metric alert rules are forwarded to the databag. Reproduce with `juju config cos-proxy forward_alert_rules=false`, using the described deployment, and verify that no alert rules are present in the cos-agent databag when forwarding is disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100