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

LogForwader doesn't handle alert rules #403

Open
saltiyazan opened this issue May 23, 2024 · 0 comments
Open

LogForwader doesn't handle alert rules #403

saltiyazan opened this issue May 23, 2024 · 0 comments

Comments

@saltiyazan
Copy link

saltiyazan commented May 23, 2024

Bug Description

LogForwarder in loki_push_api doesn't put the alert rules to relation data.
I was trying to set some logging alert rules in vault-k8s that uses LogForwarder to forward its logs to Loki through grafana-agent. I couldn't find the alert rule in Grafana, doing some debugging I could not find the alert rules nor the path to the alert rules in the relation data.
I looked at the code and found that LogForwarder doesn't do much with the alert rules path it receives in the init function.

Only the _handle_alert_rules function puts the alert rules to relation data and LogForwarder doesn't call that function.

To Reproduce

I faced this issue during development, while I was trying to add Loki alert rules to vault-k8s that uses LogForwarder, the rule I added looked like this and I added it under the default path used in the lib, this is not published to charmhub but any trying to add log alert rules to any charm that uses LogForwarder should have the same result.

  1. Deploy your charm that uses LogForwarder and has log alert rules, let's call
  2. juju deploy cos-lite --trust
  3. juju deploy grafana-agent-k8s
  4. juju integrate <your-charm>:logging grafana-agent-k8s
  5. juju integrate loki:logging grafana-agent-k8s:logging-consumer
  6. juju show-unit <your-charm>/0
  7. juju show-unit grafana-agent-k8s/0

Alert rules are not in the relation data.

Environment

LIBAPI = 1 LIBPATCH = 10

Relevant log output

N/A

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant