Skip to content

Commit

Permalink
User internal url for grafana source (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
sed-i authored Oct 12, 2023
1 parent 58e7dc1 commit 29554d0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __init__(self, *args):
self.grafana_source_provider = GrafanaSourceProvider(
charm=self,
source_type="prometheus",
source_url=self.external_url,
source_url=self.internal_url, # https://github.com/canonical/operator/issues/970
refresh_event=self.cert_handler.on.cert_changed,
)

Expand Down Expand Up @@ -485,10 +485,14 @@ def _configure(self, _):
if self._is_cert_available() and not self._is_tls_ready():
self._update_cert()

self.grafana_source_provider.update_source(self.external_url)
# We use the internal url for grafana source due to
# https://github.com/canonical/operator/issues/970
self.grafana_source_provider.update_source(self.internal_url)
self.ingress.provide_ingress_requirements(
scheme=urlparse(self.internal_url).scheme, port=self._port
)
self.remote_write_provider.update_endpoint()
self.catalogue.update_item(item=self._catalogue_item)

try:
# Need to reload if config or alerts changed.
Expand Down Expand Up @@ -563,10 +567,6 @@ def _configure(self, _):
):
return

self.remote_write_provider.update_endpoint()
self.grafana_source_provider.update_source(self.external_url)
self.catalogue.update_item(item=self._catalogue_item)

self.unit.status = ActiveStatus()

def _on_pebble_ready(self, event) -> None:
Expand Down

0 comments on commit 29554d0

Please sign in to comment.