Custom metrics
Camel 6 · 3:14
An integration can count something of its own, such as invoices processed, with a step in its route. The weikio CLI and the admin UI show that counter beside the integration's other figures.
This part of the video couldn't be loaded.
What it covers
- A Micrometer counter step,
invoices.processed, after the log step inhello.camel.yaml - Why a counter's values are fixed in the route, since each distinct value is kept as a count of its own
- Publishing and deploying the change with
weikio run - The counter table from
weikio metrics, with its count, rate a minute and route - The Last hour line of
weikio status - Opening Counters on hello's page in the admin UI, with the count, the rate a minute and a chart of the last hour
Commands in this video
Terminal
$ weikio run ./hello
$ weikio metrics sandbox/hello
$ weikio status sandbox/helloTranscript
- 0:01The earlier Camel videos left hello running in devtest.
- 0:05This video adds a step that counts hello's invoices, then reads the count with the platform's figures.
- 0:15hello runs in devtest on agent dev, from the hello folder.
- 0:19The platform already counts hello's messages,
- 0:22failures and memory.
- 0:24Your Weik.io installation keeps these as metrics.
- 0:28This video adds a metric you declare in the route.
- 0:35hello's route ends at the log step.
- 0:37A counter step follows it, in four new lines.
- 0:41The address holds three parts: the micrometer component,
- 0:45the kind counter that only goes up, and the name invoices.processed.
- 0:51Readers show the description Invoices processed beside that name.
- 0:55Nothing else is declared:
- 0:57no dependency, no installation setting.
- 1:01The counter takes nothing from the message,
- 1:03which only decides when the step runs.
- 1:06The store keeps a count for each set of values,
- 1:09so a counter opened per message runs into the store's limit.
- 1:17weikio run hello publishes the folder to your Weik.io installation.
- 1:23Ctrl-C ends the log follow, and hello keeps running.
- 1:27Weik.io builds the folder into a version.
- 1:30A version is built once, then never changes.
- 1:35The deployment follows latest,
- 1:37so the newest version is what runs now.
- 1:43A deployment sends figures every thirty seconds,
- 1:46so a new counter shows at the next send.
- 1:49weikio metrics sandbox/hello prints hello's figures,
- 1:55then its counters.
- 1:57The table gives the counter, its count,
- 2:00its rate a minute, and its route.
- 2:02The default window is the last hour.
- 2:07weikio status sandbox/hello prints the version that runs,
- 2:12the state, and the agent that runs it.
- 2:15The last hour line carries invoices.processed beside the platform's figures.
- 2:25Read the same figure on hello's Metrics page in the admin UI.
- 2:29hello's counters live under the Counters fold,
- 2:32whose heading names this one.
- 2:34The window is the last hour.
- 2:36A click opens the fold.
- 2:39The opened row runs from the counter and its description to the count,
- 2:43the rate, a chart and the route hello.
- 2:50hello counts the invoices it handles, from the last lines of its route.
- 2:55The counter lives in Weik.io, kept with hello's other figures.
- 2:59Two readers reach the same figure, the Weik.io CLI and the admin UI.