davsclaus opened a new pull request, #29384:
URL: https://github.com/apache/camel/pull/29384

   Stacked on #29381 (CAMEL-26713, chaos on the timeline), which is stacked on 
#29379 and #29378. Review those first; this PR targets the branch of #29381.
   
   ## What
   
   Found by trying the Timeline on the camel-jbang examples without chaos 
(error-handling, circuit-breaker, aggregator, splitter, filter-and-multicast), 
and from the walk of the screen.
   
   **What happened to the routes.** The timeline console records when a route 
started, stopped, was reloaded or removed, or failed to restart 
(`routeEvents`). On the Timeline they are marks in the row of the route: `▶` 
started, `■` stopped, `↻` reloaded, `✕` removed.
   
   **The seconds a circuit breaker was open.** Each second the timeline console 
reads the circuit breakers from the dev consoles of camel-resilience4j and 
camel-microprofile-fault-tolerance, and from the circuit-breaker console (the 
throttling exception route policy), so it depends on neither. It records the 
seconds one was open (2) or half open (1) as `circuitBreakers`, whichever way 
the breaker spells its state (`OPEN`, `HALF_OPEN`, `opened`, `half opened`).
   - `camel get timeline` has a `CB OPEN` column, shown only when a breaker was 
open.
   - On the Timeline, an open second is a `▒` in the row of the route (dim when 
half open), and the route says `⚡ open 10s`. That explains why a route went 
quiet, or ran its fallback, without failing.
   
   ![The circuit breaker example: the supplier fails three times, then the 
circuit breaker of stock-check is open for 10 
seconds](https://raw.githubusercontent.com/apache/camel/CAMEL-26691-timeline-explore/docs/user-manual/modules/ROOT/images/jbang/camel-tui-timeline-circuit-breaker.png)
   
   **The WARN and ERROR lines of the log as the cause.** The TUI reads the log 
file of each integration as it grows (the last 256 KB at first, whole lines 
only, and a stack trace is part of its line). It counts the WARN and ERROR 
lines per second. When no exchange failed in the window, they are the cause on 
the Timeline (`log ERROR`, `log WARN`): something that went wrong outside an 
exchange, such as a consumer that cannot connect. When an exchange failed, its 
exception is the cause, as the log has it too.
   
   **Fixes from the examples:**
   - The file examples do their work at startup, so the last minute was all 
`·`. The screen now opens on the window with the last exchange, and says when 
it was.
   - After another integration was selected, the seconds missed stayed a hole. 
They are read again.
   - Calls were shown as encoded URIs (`%24%7Bheader…`). They are decoded.
   - `avg 4ms, p95 2s`: the average counted the idle seconds. It is now the 
average of the seconds with exchanges.
   - The selected route's name ran into its row (`>> stock-check···`).
   
   ## Docs
   
   The Timeline section of the observe page (the marks, circuit breakers, log 
lines, and the recovered exchanges of #29378), with a new screenshot taken live 
on the circuit-breaker example. Also the help page, the diagnostics page (`CB 
OPEN`), and the MCP tool and its page. The catalog copies and the dev consoles 
OpenAPI file are regenerated.
   
   ## Tests
   
   - `TimelineDevConsoleTest`: route events, a circuit breaker open then half 
open, and how each kind spells its state.
   - `TimelineRecorderTest`.
   - `ListTimelineTest`: the `CB OPEN` column, and no column without one.
   - `TimelineTest` and `TimelineTabRenderTest`: route events, the `▒` and `⚡ 
open 10s`, gaps read again, the quiet window.
   - `TimelineLogTest`: the lines per second as the log grows, a half-written 
line, a big log read from its last part, coloured lines, and no log cause when 
an exchange failed.
   - The full TUI suite passes locally. Tried live on the circuit-breaker 
example, with the TUI and `camel get timeline`.
   
   JIRA: https://issues.apache.org/jira/browse/CAMEL-26691
   
   _Claude Code on behalf of Claus Ibsen_
   


-- 
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]

Reply via email to