Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PietroPasotti committed Aug 8, 2024
1 parent 1602e06 commit 3c7b521
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class GrafanaAgentK8sCharm(GrafanaAgentCharm):
{"logging-consumer"}, # or
{"grafana-cloud-config"},
],
"tracing-provider": [ # must be paired with:
{"tracing"}, # or
{"grafana-cloud-config"},
],
"grafana-dashboards-consumer": [ # must be paired with:
{"grafana-dashboards-provider"}, # or
{"grafana-cloud-config"},
Expand Down
3 changes: 2 additions & 1 deletion src/grafana_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ def _update_status(self, *_):
"logging-consumer",
"grafana-dashboards-provider",
}
missing_rels = (
# sorting is so that the order doesn't keep flapping on each hook depending on <whims>
missing_rels = sorted(
cos_rels.difference(active_relations)
if cos_rels.intersection(active_relations)
else set()
Expand Down
2 changes: 1 addition & 1 deletion tests/scenario/test_setup_statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_charm_start_with_container(vroot):
out = context.run(agent.pebble_ready_event, state)

assert out.unit_status == BlockedStatus(
"Missing incoming ('requires') relation: metrics-endpoint|logging-provider|grafana-dashboards-consumer"
"Missing incoming ('requires') relation: metrics-endpoint|logging-provider|tracing-provider|grafana-dashboards-consumer"
)
agent_out = out.get_container("agent")
assert agent_out.services["agent"].current == pebble.ServiceStatus.ACTIVE

0 comments on commit 3c7b521

Please sign in to comment.