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

feat: add grafana_base_url to Grafana source #494

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MichaelThamm
Copy link
Contributor

@MichaelThamm MichaelThamm commented Mar 3, 2025

Issue

Loki needs to know the Grafana base URL for its ruler config which may have an ingress. This is needed to correctly render the Source button URL to Grafana when Loki alert rules are firing:
image

Solution

Is this relation the best way to give Loki the ingress URL from Grafana? It makes sense since this scenario requires the grafana-source relation, otherwise Loki logs won't make it to Grafana and this scenario won't be possible.

  • Add tests for Loki consuming the grafana URL

Context

Testing Instructions

  1. Create an always firing Loki alert rule in the Zinc charm:
alert: HostHighLogErrorRate
expr: count_over_time({juju_application="zinc"} [1h]) > -1
for: 0m
labels:
  severity: warning
annotations:
  summary: High error rate in logs (instance {{ $labels.instance }})
  description: "High error rate in logs\n  VALUE = {{ $value }}\n  LABELS = {{ $labels }}"
  1. Pack the zinc charm
  2. Deploy Zinc
  3. Deploy cos-lite
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
juju deploy 
  1. Pack the Loki and Grafana charms with the changes in this PR and the tandem PR
  2. juju refresh both charms with the packed charms
  3. Relate Zinc to Loki for logging and generate some logs in the Zinc UI (log in or run a query)
  4. Check the Alertmanager UI for the Source button link to Grafana ingress URL instead of Loki's ingress URL

Upgrade Notes

.

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

Successfully merging this pull request may close these issues.

1 participant