davsclaus opened a new pull request, #29349: URL: https://github.com/apache/camel/pull/29349
_Claude Code on behalf of Claus Ibsen_ [CAMEL-26695](https://issues.apache.org/jira/browse/CAMEL-26695), step 3b: the 🎲 marks on the exchanges a chaos rule faulted, so a failure made on purpose is not debugged as a real one. **Stacked on #29348** (3a), on #29347 (2), on #29346 (1). Retarget as they merge.  *Live, against `camel run --chaos` with `endpoint=http://localhost:8765/stock* error status=503 rate=0.3`: the `orders` exchanges r1 faulted are marked `🎲r1`. They still finished OK, about 100ms later, because redelivery recovered them. The detail of the selected one says "injected by chaos rule r1", with the rule, and shows its two sends to stock.* ### Where the marks are - **Activity**: `🎲r1` after the exchange id. The detail gets a `Chaos:` line: "🎲 injected by chaos rule r1", with the rule. - **Errors**: `🎲r1` before the exception type (live: the three errors that went to the dead letter channel). The detail gets the same `Chaos:` line. - **Inspect**: the detail of a step (message history and trace) gets the `Chaos:` line. ### How an exchange is known - An error has the exchange properties, and camel-chaos sets `CamelChaosRule` on an exchange a rule faulted (CAMEL-26678). - An activity entry and a message history step have no properties. For them, `ChaosMarks` remembers the exchange ids of the chaos report's recent faults as the status comes in (every second, in `DataRefreshService`). It keeps up to the last 2000 per integration. - At very high fault rates (more than 20 faults in a second, the size of the recent faults list), some exchanges are not marked. Errors are always marked from their property. ### Code - `ChaosMarks`: the store, `ruleOf` (property first, then the store), the cells and the detail line. - `MonitorContext.chaosMarks`, fed by `DataRefreshService`. - One-line changes in `ActivityTab` (the cell, and the detail, which now gets the integration), `ErrorsTab` (the cell and the detail) and `HistoryTab` (the two detail panels). - `SourceSizeTest`: `HistoryTab.java` is at its recorded limit, so the limit goes from 2720 to 2722 for the two call lines (Claus said the limits can be raised). The code itself is in `ChaosMarks`. - Help page and `camel-jbang-tui-observe.adoc`, with the screenshot. ### Tests - New `ChaosMarksTest` (5): - the rule from the property or from the recent faults, and none without chaos; - the store bounded to the last 2000; - the Activity tab marking only the faulted exchange, with the detail line; - the Errors tab marking from the property, with the detail line; - no detail line for an exchange no rule faulted. - The whole camel-jbang-plugin-tui suite: 2325 tests pass (1 skipped). `LaunchManagerOutcomeTest` flaked once, then passed on rerun; it is unrelated. - Live, a scratch TUI on the packaged plugin: the Activity screenshot above, and the Errors tab marking the three errors that reached the dead letter channel, from `CamelChaosRule`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_012nJsFsjqqFiwroeHRWaKbS -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
