From d6278deaf4459ad268a88dd1d5c804c2881f0614 Mon Sep 17 00:00:00 2001 From: Luca Bello Date: Tue, 16 Jul 2024 09:40:42 +0200 Subject: [PATCH 1/3] feat: use external_url in grafana source --- src/charm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index 69f11ee1..4a7fd080 100755 --- a/src/charm.py +++ b/src/charm.py @@ -210,7 +210,7 @@ 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 + source_url=self.external_url, refresh_event=self.cert_handler.on.cert_changed, extra_fields={"timeInterval": PROMETHEUS_GLOBAL_SCRAPE_INTERVAL}, ) From ac15d1aadd983cb8f7a89e1835c0dc96efb9e4ca Mon Sep 17 00:00:00 2001 From: Luca Bello Date: Tue, 16 Jul 2024 09:56:45 +0200 Subject: [PATCH 2/3] add ingress refresh events --- src/charm.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index 4a7fd080..96362a74 100755 --- a/src/charm.py +++ b/src/charm.py @@ -211,7 +211,12 @@ def __init__(self, *args): charm=self, source_type="prometheus", source_url=self.external_url, - refresh_event=self.cert_handler.on.cert_changed, + refresh_event=[ + self.ingres.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}, ) From ce80d0a520b5bf0dbcd66086b82a54d16e10fb5e Mon Sep 17 00:00:00 2001 From: Luca Bello Date: Tue, 16 Jul 2024 10:22:28 +0200 Subject: [PATCH 3/3] fix typo --- src/charm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index 96362a74..ccee97eb 100755 --- a/src/charm.py +++ b/src/charm.py @@ -212,7 +212,7 @@ def __init__(self, *args): source_type="prometheus", source_url=self.external_url, refresh_event=[ - self.ingres.on.ready_for_unit, + self.ingress.on.ready_for_unit, self.ingress.on.revoked_for_unit, self.on.update_status, self.cert_handler.on.cert_changed,