From 76e80816dc67958fa8be6752ef99b34371e84f87 Mon Sep 17 00:00:00 2001 From: Luca Bello <36242061+lucabello@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:35:14 +0200 Subject: [PATCH] feat: use external_url in grafana source (#632) * feat: use external_url in grafana source * add ingress refresh events * fix typo --- src/charm.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/charm.py b/src/charm.py index 69f11ee1..ccee97eb 100755 --- a/src/charm.py +++ b/src/charm.py @@ -210,8 +210,13 @@ def __init__(self, *args): self.grafana_source_provider = GrafanaSourceProvider( charm=self, source_type="prometheus", - source_url=self.internal_url, # https://github.com/canonical/operator/issues/970 - refresh_event=self.cert_handler.on.cert_changed, + source_url=self.external_url, + refresh_event=[ + self.ingress.on.ready_for_unit, + self.ingress.on.revoked_for_unit, + self.on.update_status, + self.cert_handler.on.cert_changed, + ], extra_fields={"timeInterval": PROMETHEUS_GLOBAL_SCRAPE_INTERVAL}, )