diff --git a/lib/charms/grafana_agent/v0/cos_agent.py b/lib/charms/grafana_agent/v0/cos_agent.py index e3e8948..9b6a419 100644 --- a/lib/charms/grafana_agent/v0/cos_agent.py +++ b/lib/charms/grafana_agent/v0/cos_agent.py @@ -743,7 +743,7 @@ def _dashboards(self) -> List[str]: for path in Path(d).glob("*"): with open(path, "rt") as fp: dashboard = json.load(fp) - rel_path = str(path.relative_to(self._charm.charm_dir)) + rel_path = str(path.relative_to(self._charm.charm_dir) if path.is_absolute() else path) # COSAgentProvider is analogous to GrafanaDashboardProvider. We need to set the alt_uid so it represents # the dashboard correctly across the ecosystem. # https://github.com/canonical/grafana-k8s-operator/pull/363