Skip to content

Backport/2024.1 lp2159965#888

Merged
MylesJP merged 2 commits into
canonical:stable/2024.1from
MylesJP:backport/2024.1-lp2159965
Jul 17, 2026
Merged

Backport/2024.1 lp2159965#888
MylesJP merged 2 commits into
canonical:stable/2024.1from
MylesJP:backport/2024.1-lp2159965

Conversation

@MylesJP

@MylesJP MylesJP commented Jul 16, 2026

Copy link
Copy Markdown

Clean backport of #884 to stable/2024.1.

sunbeam enable observability external ... on MAAS deployments timed out after 30 minutes with the opentelemetry-collector charms stuck in blocked across the openstack, openstack-machines, and openstack-infra models, and the COS offers were never consumed or related.

With an external COS, the collector's COS relations are only created by IntegrateRemoteCosOffersStep after all agents are deployed, since the terraform juju provider cannot consume offers across controllers (juju/terraform-provider-juju#119). The infra agent deploy step added in eb3c568 runs before that and waits for the collector to reach active — which it can never do at that point. The enable therefore timed out at the infra step and aborted before any integrations were created, leaving every model's collector blocked.

This PR contains two commits:

  1. Accept blocked status for the infra agent deploy step in the external flow, matching the other agent deploy steps which already pass ["active", "blocked"]. The collector settles to active once IntegrateRemoteCosOffersStep integrates the offers. The embedded flow is unchanged.

  2. Fix the stale logging-consumer endpoint in RemoveRemoteCosOffersStep, left behind by the grafana-agent → opentelemetry-collector migration (f5fc0a1, partially fixed in 7fdf5bd), so disabling external observability actually removes the loki relation instead of silently skipping it and then waiting for a blocked status that may never come.

Both commits cherry-picked cleanly from main with no conflicts.

Assisted-By: Claude Fable 5

Closes-bug: #2159965

QA steps

  1. Deploy a MAAS-backed Sunbeam cloud from the 2024.1 channel (must be MAAS so the openstack-infra model exists).
  2. Deploy COS on a separate Juju controller (e.g. cos-lite on MicroK8s/Canonical K8s), create the grafana-dashboards, receive-remote-write, and loki-logging offers, and register that controller on the Sunbeam client.
  3. Run sunbeam enable observability external <controller> <grafana-dashboard-offer-url> <prometheus-receive-remote-write-offer-url> <loki-logging-offer-url>.
  4. Verify the command completes without hitting the 30-minute timeout, and that juju status in the openstack, openstack-machines, and openstack-infra models shows opentelemetry-collector active with the consumed COS SaaS relations in place. Confirm metrics/dashboards/logs arrive in the external Grafana.
  5. Run sunbeam disable observability external and verify it completes, with all three COS relations (including loki) removed in each model.

Unit tests (tox -e unit) and lint (tox -e pep8) pass on this branch, including the TestExternalObservabilityEnablePlans regression tests backported with the fix.

Links

Jira card: OPEN-4643
Launchpad bug: LP#2159965
Original PR: #884

MylesJP added 2 commits July 16, 2026 07:19
With an external COS, the opentelemetry-collector COS relations are
only created by IntegrateRemoteCosOffersStep after all agents are
deployed, since the terraform juju provider cannot consume offers
across controllers. The infra model agent deploy step introduced in
eb3c568 waits for the collector to reach active status, which it can
never do at that point, so `sunbeam enable observability external` on
MAAS deployments timed out after 30 minutes and the COS offers were
never consumed or related in any model.

Accept blocked status for the infra agent deploy step, matching the
other agent deploy steps in the external flow. The collector settles
to active once the offers are integrated by the subsequent step.

Closes-Bug: #2159965
Signed-off-by: Myles Penner <myles.penner@canonical.com>
Assisted-by: Claude Fable 5
(cherry picked from commit 09baf98)
The migration from grafana-agent to opentelemetry-collector (f5fc0a1)
kept the grafana-agent loki endpoint name logging-consumer, which does
not exist on the opentelemetry-collector charm. Commit 7fdf5bd
corrected it to send-loki-logs in IntegrateRemoteCosOffersStep but
missed RemoveRemoteCosOffersStep, so disabling external observability
silently skipped removing the loki relation and then waited for the
collector to reach blocked status, which it may never do while the
relation remains.

Signed-off-by: Myles Penner <myles.penner@canonical.com>
Assisted-by: Claude Fable 5
(cherry picked from commit eb0eead)
@gboutry
gboutry self-requested a review July 16, 2026 14:31
@Raven-182
Raven-182 self-requested a review July 17, 2026 13:08
@MylesJP
MylesJP merged commit 9b1a8e4 into canonical:stable/2024.1 Jul 17, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants