Skip to content

fix(observability): replace an alert whose stream moved instead of editing it - #313

Merged
rldyourmnd merged 1 commit into
mainfrom
fix/replace-an-alert-whose-stream-moved
Aug 31, 2026
Merged

fix(observability): replace an alert whose stream moved instead of editing it#313
rldyourmnd merged 1 commit into
mainfrom
fix/replace-an-alert-whose-stream-moved

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

OpenObserve accepts a PUT that changes an alert's stream_name and keeps the stream it already had. Everything else in the document lands.

So a rule whose metric moves plans an update that can never converge: expression and threshold change, the stream does not, and every subsequent reconcile reports the identical drift.

Observed live

Moving lifecycle_queued_delivery_stall and queue_wait_slow_burn off the state clock:

  • apply returned OpenObserve read-back did not converge
  • replanning produced the same two update actions
  • reading the alert back showed the new expression and threshold 1800 sitting on the old gha_fleet_queue_intent_oldest_state_age_seconds

The alerts still delivered to the owner named the old stream while evaluating the new query — which is the worst version of this, because the message contradicts the rule.

The change

A moved stream is planned as delete + create. The fleet was converged by hand that way before this fix, after which the reconcile reported state: managed, actions: 0.

The fake was wrong in the same direction as the code

The test double accepted the whole document on PUT, so it could not reproduce the failure it existed to cover — a green suite over a store that behaves differently from the real one. It now keeps the previous stream_name, as OpenObserve does.

Verified by mutation: with the replacement branch disabled the plan falls back to one update and TestMovingAStreamReplacesTheAlertRatherThanEditingIt fails.

…iting it

OpenObserve accepts a PUT that changes an alert's stream_name and keeps the
stream it already had. Everything else in the document lands. So a rule
whose metric moves plans an update that can never converge: the expression
and the threshold change, the stream does not, and every subsequent
reconcile reports the identical drift.

Observed live moving lifecycle_queued_delivery_stall and queue_wait_slow_burn
off the state clock. Apply returned "OpenObserve read-back did not
converge", replanning produced the same two updates, and reading the alert
back showed the new expression and threshold 1800 sitting on
gha_fleet_queue_intent_oldest_state_age_seconds. The alerts delivered to the
owner still named the old stream while evaluating the new query.

A moved stream is now planned as delete plus create. The fleet was
converged by hand this way before the fix, and the reconcile then reported
managed with zero actions.

The test fake was wrong in the same direction as the code: it accepted the
whole document on PUT, so it could not reproduce the failure it was meant
to cover. It now keeps the previous stream_name the way the real store
does. Verified by mutation -- with the replacement branch disabled the plan
falls back to a single update and the test fails.
@rldyourmnd
rldyourmnd merged commit 417d98e into main Aug 31, 2026
10 checks passed
@rldyourmnd
rldyourmnd deleted the fix/replace-an-alert-whose-stream-moved branch August 31, 2026 15:46
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.

1 participant