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

   ## What
   
   A new `timeline` dev console records, for each second of the last 5 minutes 
(`camel.devConsole.timeline.seconds`, 60 to 3600), what happened in the 
integration:
   
   - **per route**: exchanges completed, recovered by a redelivery, handled by 
the error handler, failed; mean, p95 and max time; in flight; redelivery 
attempts
   - **errors** per second by route and exception, with the HTTP status code, 
and the camel-chaos rule that made one
   - **kept exchanges** per second: the failed and handled ones (up to 10) and 
the 3 slowest, with the remote calls they made
   
   It records from the start, whenever the dev consoles are on (as with `camel 
run`, profile `dev`), so a tool that looks later still has the last minutes.
   
   ### How it is recorded
   
   - The route outcomes come from the route counters (JMX), sampled at each 
whole second by one scheduled thread, so each second is exact.
   - An exchange counts as **recovered** in the route where it was redelivered, 
from the `ExchangeRedeliveryEvent`s. It is not counted from the 
`CamelRedelivered` header, so a route that removes the Camel headers still 
counts its recoveries (the route counters do not, see CAMEL-26712).
   - The errors, kept exchanges and calls come from the exchange events.
   - A copy done in the route of the exchange it was copied from is part of 
that exchange: a part of a split or multicast, or the copy a circuit breaker 
runs. Its calls are added to that exchange. A copy that a route of its own 
consumes (seda, wire tap) counts in that route.
   
   ### Where it shows
   
   - `camel get timeline` prints a line per route (totals, mean, max, and 
exchanges per second as a sparkline). `--errors` lists the errors by route and 
exception, and `--exchanges` lists the kept exchanges. It replaces `camel get 
activity`.
   - The MCP tool `camel_runtime_timeline` and the shared tool `get_timeline` 
(for `camel ask` and the TUI AI).
   - The CLI connector writes the last 10 seconds as `<pid>-timeline.json` each 
second. The new `timeline` action returns all of it (or `seconds`, `routeId`, 
`exchanges`). The Timeline screen of the TUI is built on this in the follow-up 
PR.
   
   ### Removed: the activity of the backlog tracer
   
   It kept the last 100 completed exchanges, which under load was only the last 
seconds, and the timeline replaces it. The 4.24 upgrade guide lists all of 
these:
   
   - 
`BacklogTracer.isActivityEnabled/setActivityEnabled/getActivitySize/setActivitySize/getActivity/dumpActivity/dumpActivityAsJSon`
 and `BacklogTracerActivityMessage`
   - the JMX attributes and the operation of the backlog tracer MBean
   - `camel.trace.activityEnabled` and `camel.trace.activitySize`
   - the `activity` dev console
   - `Exchange.ACTIVITY_SPAN_TAGS`, which camel-telemetry set but nothing read
   - `camel get activity`
   - the `<pid>-activity.json` file and the `activity` snapshot of the CLI 
connector
   
   The activity was in 4.22, but only our own tooling (TUI, CLI) used it. 
Discussed with Claus: remove, with an upgrade-guide entry.
   
   The catalog copy of the console JSON and `dev-consoles-openapi.json` were 
regenerated (the openapi with `DevConsoleOpenApiHelper`, only the 
activity/timeline entries change).
   
   ## Tests
   
   - `TimelineRecorderTest`: the rise of the counters per second, a late sample 
spread over its seconds, a counter reset, recovered in the route that 
redelivered, handled and failed not recovered, the kept exchanges, split parts 
and circuit breaker copies, p95/max, calls, errors per second, eviction, the 
ring.
   - `TimelineDevConsoleTest` (JMX): the routes, errors and exchanges of a live 
context; a recovery counted although the route removes `Camel*`; the options; 
the parts of a split not kept.
   - `ListTimelineTest`, `RuntimeToolsTest` (the `get_timeline` tool), the CLI 
golden files, and the connector tests updated.
   - Ran locally: camel-console, camel-api, camel-main (325), camel-management 
tracer tests, camel-telemetry, camel-cli-connector, camel-jbang-mcp (540) and 
camel-jbang-core (2645) all pass. The one exception is `DoctorRepositoryTest`, 
which fails only with the scratch Maven repo setup I used locally.
   - Tried live against a running integration with camel-chaos: `camel get 
timeline` and the TUI on top of it.
   
   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