Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added rules for capturing Apache Camel metrics exposed by jmx MBean
Browse files Browse the repository at this point in the history
luigidemasi committed Jul 27, 2024
1 parent da20d8b commit 427fa2a
Showing 4 changed files with 315 additions and 0 deletions.
1 change: 1 addition & 0 deletions instrumentation/jmx-metrics/javaagent/README.md
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ $ java -javaagent:path/to/opentelemetry-javaagent.jar \
No targets are enabled by default. The supported target environments are listed below.

- [activemq](activemq.md)
- [camel](camel.md)
- [jetty](jetty.md)
- [kafka-broker](kafka-broker.md)
- [tomcat](tomcat.md)
51 changes: 51 additions & 0 deletions instrumentation/jmx-metrics/javaagent/camel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Camel Metrics

Here is the list of metrics based on MBeans exposed by Camel.

| Metric Name | Type | Attributes | Description |
|---------------------------------------------|---------------|----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| camel.context.exchanges.completed | Counter | context, camelVersion | Indicates the total number of exchanges processed successfully since context start-up or the last reset operation |
| camel.context.exchanges.failed | Counter | context, camelVersion | Indicates the total number of exchanges that failed to process since context start-up or the last reset operation. |
| camel.context.exchanges.inflight | UpDownCounter | context, camelVersion | Indicates the number of exchanges currently transiting the context. |
| camel.context.exchanges.total | Counter | context, camelVersion | Indicates the total number of exchanges, passed or failed, processed context start-up or the last reset operation. |
| camel.context.failures.handled | Counter | context, camelVersion | Indicates the number of exchanges failed and handled by an ExceptionHandler in the context. |
| camel.context.external.redeliveries.count | Counter | context, camelVersion | The total number of all external redeliveries since context start-up or the last reset operation. |
| camel.context.max.processing.time | Gauge | context, camelVersion | Indicates the longest time, in milliseconds, to process an exchange since context start-up or the last reset operation. |
| camel.context.mean.processing.time | Gauge | context, camelVersion | Indicates the average processing time, in milliseconds, for all exchanges processed since context start-up or the last reset operation. |
| camel.context.min.processing.time | Gauge | context, camelVersion | Indicates the shortest time, in milliseconds, to process an exchange since context start-up or the last reset operation. |
| camel.context.last.processing.time | Gauge | context, camelVersion | Indicates the time, in milliseconds, it took to process the last exchange. |
| camel.context.delta.processing.time | Gauge | context, camelVersion | Indicates the difference, in milliseconds, of the Processing Time of the last two exchanges transited the context. |
| camel.context.total.processing.time | Counter | context, camelVersion | Indicates the total processing time, in milliseconds, to process all exchanges since context start-up or the last reset operation. |
| camel.context.redeliveries.count | Counter | context, camelVersion | Number of redeliveries happened since context start-up or the last reset operation. |
| camel.route.exchanges.completed | Counter | context, route | Indicates the total number of exchanges the route has processed successfully since route start-up or the last reset operation. |
| camel.route.exchanges.failed | Counter | context, route | Indicates the total number of exchanges that the route has failed to process since route start-up or the last reset operation. |
| camel.route.exchanges.inflight | UpDownCounter | context, route | Indicates the number of exchanges currently transiting the route. |
| camel.route.exchanges.total | Counter | context, route | Indicates the total number of exchanges, passed or failed, that the route has processed since route start-up or the last reset operation. |
| camel.route.failures.handled | Counter | context, route | Indicates the number of exchanges failed and handled by an ExceptionHandler in the route. |
| camel.route.external.redeliveries.count | Counter | context, route | The total number of all external redeliveries since the route start-up or the last reset operation. |
| camel.route.max.processing.time | Gauge | context, route | Indicates the longest time, in milliseconds, to process an exchange since the route start-up or the last reset operation. |
| camel.route.mean.processing.time | Gauge | context, route | Indicates the average processing time, in milliseconds, for all exchanges processed since the route start-up or the last reset operation. |
| camel.route.min.processing.time | Gauge | context, route | Indicates the shortest time, in milliseconds, to process an exchange since the route start-up or the last reset operation. |
| camel.route.last.processing.time | Gauge | context, route | Indicates the time, in milliseconds, it took the route to process the last exchange. |
| camel.route.delta.processing.time | Gauge | context, route | Indicates the difference, in milliseconds, of the Processing Time of the last two exchanges transited the route. |
| camel.route.total.processing.time | Counter | context, route | Indicates the total processing time, in milliseconds, of all exchanges the selected processed since route start-up or the last reset operation. |
| camel.route.redeliveries.count | Counter | context, route | Number of redeliveries happened since route start-up or the last reset operation. |
| camel.processor.exchanges.completed | Counter | context, route, processor, destination | Indicates the total number of exchanges the selected processor has processed successfully since processor start-up or the last reset operation. |
| camel.processor.exchanges.failed | Counter | context, route, processor, destination | Indicates the total number of exchanges that the selected processor has failed to process since processor start-up or the last reset operation. |
| camel.processor.exchanges.inflight | UpDownCounter | context, route, processor, destination | Indicates the number of exchanges currently transiting the processor. |
| camel.processor.exchanges.total | Counter | context, route, processor, destination | Indicates the total number of exchanges, passed or failed, that the selected processor has processed since processor start-up or the last reset operation. |
| camel.processor.failures.handled | Counter | context, route, processor, destination | Indicates the number of exchanges failed and handled by an ExceptionHandler in the context. |
| camel.processor.external.redeliveries.count | Counter | context, route, processor, destination | The total number of all external redeliveries since processor start-up or the last reset operation. |
| camel.processor.max.processing.time | Gauge | context, route, processor, destination | Indicates the longest time, in milliseconds, to process an exchange since processor start-up or the last reset operation. |
| camel.processor.mean.processing.time | Gauge | context, route, processor, destination | Indicates the average processing time, in milliseconds, for all exchanges processed since processor start-up or the last reset operation. |
| camel.processor.min.processing.time | Gauge | context, route, processor, destination | Indicates the shortest time, in milliseconds, to process an exchange since processor start-up or the last reset operation. |
| camel.processor.last.processing.time | Gauge | context, route, processor, destination | Indicates the time, in milliseconds, it took the selected processor to process the last exchange. |
| camel.processor.delta.processing.time | Gauge | context, route, processor, destination | Indicates the difference, in milliseconds, of the Processing Time of the last two exchanges transited the selected processor. |
| camel.processor.total.processing.time | Counter | context, route, processor, destination | Indicates the total processing time, in milliseconds, to process all exchanges since start-up or the last reset operation. |
| camel.processor.redeliveries.count | Counter | context, route, processor, destination | Number of redeliveries happened since selected processor start-up or the last reset operation. |
| camel.threadpool.active.count | UpDownCounter | context, route | The approximate number of threads that are actively executing tasks. |
| camel.threadpool.completed.task.count | Counter | context, route | The approximate total number of tasks that have completed execution. Because the states of tasks and threads may change dynamically during computation, the returned value is only an approximation, but one that does not ever decrease across successive calls. |
| camel.threadpool.pool.size | UpDownCounter | context, route | The current number of threads in the pool. |
| camel.threadpool.largest.pool.size | Counter | context, route | The largest number of threads that have ever simultaneously been in the pool. |
| camel.threadpool.task.count | Counter | context, route | The approximate total number of tasks that have ever been scheduled for execution. |
| camel.threadpool.task.queue.size | UpDownCounter | context, route | The number of Tasks in the Task Queue |
Original file line number Diff line number Diff line change
@@ -0,0 +1,262 @@
---
rules:
- bean: org.apache.camel:context=*,type=context,name=*
prefix: camel.context.
metricAttribute:
context: param(context)
camelVersion: beanattr(CamelVersion)
mapping:
ExchangesCompleted:
metric: exchange.completed
type: counter
unit: "{exchanges}"
desc: Indicates the total number of exchanges processed successfully since context start-up or the last reset operation
ExchangesFailed:
metric: exchange.failed
type: counter
unit: "{exchanges}"
desc: Indicates the total number of exchanges that failed to process since context start-up or the last reset operation.
ExchangesInflight:
metric: exchange.inflight
type: updowncounter
unit: "{exchanges}"
desc: Indicates the number of exchanges currently transiting the context.
ExchangesTotal:
metric: exchange.total
type: counter
unit: "{exchanges}"
desc: Indicates the total number of exchanges, passed or failed, processed context start-up or the last reset operation.
FailuresHandled:
metric: failure.handled
unit: "{exchanges}"
type: counter
desc: Indicates the number of exchanges failed and handled by an ExceptionHandler in the context.
ExternalRedeliveries:
metric: external.redelivery.count
type: counter
unit: "{redeliveries}"
desc: The total number of all external redeliveries since context start-up or the last reset operation.
MaxProcessingTime:
metric: max.processing.time
unit: ms
type: gauge
desc: Indicates the longest time, in milliseconds, to process an exchange since context start-up or the last reset operation.
MeanProcessingTime:
metric: mean.processing.time
type: gauge
unit: ms
desc: Indicates the average processing time, in milliseconds, for all exchanges processed since context start-up or the last reset operation.
MinProcessingTime:
metric: min.processing.time
unit: ms
type: gauge
desc: Indicates the shortest time, in milliseconds, to process an exchange since context start-up or the last reset operation.
LastProcessingTime:
metric: last.processing.time
unit: ms
type: gauge
desc: Indicates the time, in milliseconds, it took to process the last exchange.
DeltaProcessingTime:
metric: delta.processing.time
type: gauge
unit: ms
desc: Indicates the difference, in milliseconds, of the Processing Time of the last two exchanges transited the context.
TotalProcessingTime:
metric: total.processing.time
type: counter
unit: ms
desc: Indicates the total processing time, in milliseconds, to process all exchanges since context start-up or the last reset operation.
Redeliveries:
metric: redelivery.count
type: counter
unit: "{redeliveries}"
desc: Number of redeliveries happened since context start-up or the last reset operation.

# Route Level metrics

- bean: org.apache.camel:context=*,type=routes,name=*
prefix: camel.route.
metricAttribute:
route: beanattr(RouteId)
context: param(context)
mapping:
ExchangesCompleted:
metric: exchange.completed
type: counter
unit: "{exchanges}"
desc: Indicates the total number of exchanges the route has processed successfully since route start-up or the last reset operation.
ExchangesFailed:
metric: exchange.failed
type: counter
unit: "{exchanges}"
desc: Indicates the total number of exchanges that the route has failed to process since route start-up or the last reset operation.
ExchangesInflight:
metric: exchange.inflight
type: updowncounter
unit: "{exchanges}"
desc: Indicates the number of exchanges currently transiting the route.
ExchangesTotal:
metric: exchange.total
unit: "{exchanges}"
type: counter
desc: Indicates the total number of exchanges, passed or failed, that the route has processed since route start-up or the last reset operation.
FailuresHandled:
metric: failure.handled
unit: "{exchanges}"
type: counter
desc: Indicates the number of exchanges failed and handled by an ExceptionHandler in the route.
ExternalRedeliveries:
metric: external.redelivery.count
unit: "{redeliveries}"
type: counter
desc: The total number of all external redeliveries since the route start-up or the last reset operation.
MaxProcessingTime:
metric: max.processing.time
unit: ms
type: gauge
desc: Indicates the longest time, in milliseconds, to process an exchange since the route start-up or the last reset operation.
MeanProcessingTime:
metric: mean.processing.time
unit: ms
type: gauge
desc: Indicates the average processing time, in milliseconds, for all exchanges processed since the route start-up or the last reset operation.
MinProcessingTime:
metric: min.processing.time
type: gauge
unit: ms
desc: Indicates the shortest time, in milliseconds, to process an exchange since the route start-up or the last reset operation.
LastProcessingTime:
metric: last.processing.time
type: gauge
unit: ms
desc: Indicates the time, in milliseconds, it took the route to process the last exchange.
DeltaProcessingTime:
metric: delta.processing.time
type: gauge
unit: ms
desc: Indicates the difference, in milliseconds, of the Processing Time of the last two exchanges transited the route.
TotalProcessingTime:
metric: total.processing.time
type: counter
unit: ms
desc: Indicates the total processing time, in milliseconds, of all exchanges the selected processed since route start-up or the last reset operation.
Redeliveries:
metric: redelivery.count
type: counter
unit: "{redeliveries}"
desc: Number of redeliveries happened since route start-up or the last reset operation.


# Processor level Metrics

- bean: org.apache.camel:context=*,type=processors,name=*
prefix: camel.processor.
metricAttribute:
processor: beanattr(ProcessorId)
route: beanattr(RouteId)
context: param(context)
destination: beanattr(Destination)
mapping:
ExchangesCompleted:
metric: exchange.completed
type: counter
unit: "{exchanges}"
desc: Indicates the total number of exchanges the selected processor has processed successfully since processor start-up or the last reset operation.
ExchangesFailed:
metric: exchange.failed
type: counter
unit: "{exchanges}"
desc: Indicates the total number of exchanges that the selected processor has failed to process since processor start-up or the last reset operation.
ExchangesInflight:
metric: exchange.inflight
type: updowncounter
unit: "{exchanges}"
desc: Indicates the number of exchanges currently transiting the processor.
ExchangesTotal:
metric: exchange.total
type: counter
unit: "{exchanges}"
desc: Indicates the total number of exchanges, passed or failed, that the selected processor has processed since processor start-up or the last reset operation.
FailuresHandled:
metric: failure.handled
unit: "{exchanges}"
type: counter
desc: Indicates the number of exchanges failed and handled by an ExceptionHandler in the context.
ExternalRedeliveries:
metric: external.redelivery.count
type: counter
unit: "{redeliveries}"
desc: The total number of all external redeliveries since processor start-up or the last reset operation.
MaxProcessingTime:
metric: max.processing.time
unit: ms
type: gauge
desc: Indicates the longest time, in milliseconds, to process an exchange since processor start-up or the last reset operation.
MeanProcessingTime:
metric: mean.processing.time
type: gauge
unit: ms
desc: Indicates the average processing time, in milliseconds, for all exchanges processed since processor start-up or the last reset operation.
MinProcessingTime:
metric: min.processing.time
type: gauge
unit: ms
desc: Indicates the shortest time, in milliseconds, to process an exchange since processor start-up or the last reset operation.
LastProcessingTime:
metric: last.processing.time
type: gauge
unit: ms
desc: Indicates the time, in milliseconds, it took the selected processor to process the last exchange.
DeltaProcessingTime:
metric: delta.processing.time
type: gauge
unit: ms
desc: Indicates the difference, in milliseconds, of the Processing Time of the last two exchanges transited the selected processor.
TotalProcessingTime:
metric: total.processing.time
type: counter
unit: ms
desc: Indicates the total processing time, in milliseconds, to process all exchanges since start-up or the last reset operation.
Redeliveries:
metric: redelivery.count
type: counter
unit: "{redeliveries}"
desc: Number of redeliveries happened since selected processor start-up or the last reset operation.


- bean: org.apache.camel:context=*,type=threadpools,name=*
prefix: camel.threadpool.
metricAttribute:
route: beanattr(RouteId)
context: param(context)
mapping:
ActiveCount:
metric: active.count
type: updowncounter
unit: "{threads}"
desc: The approximate number of threads that are actively executing tasks.
CompletedTaskCount:
metric: completed.task.count
type: counter
unit: "{tasks}"
desc: The approximate total number of tasks that have completed execution. Because the states of tasks and threads may change dynamically during computation, the returned value is only an approximation, but one that does not ever decrease across successive calls.
PoolSize:
metric: pool.size
type: updowncounter
unit: "{threads}"
desc: The current number of threads in the pool.
LargestPoolSize:
metric: largest.pool.size
type: counter
unit: "{threads}"
desc: The largest number of threads that have ever simultaneously been in the pool.
TaskCount:
metric: task.count
type: counter
unit: "{tasks}"
desc: The approximate total number of tasks that have ever been scheduled for execution.
TaskQueueSize:
metric: task.queue.size
type: updowncounter
unit: "{threads}"
desc: The number of Tasks in the Task Queue
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ class JmxMetricInsightInstallerTest {
new HashSet<>(
Arrays.asList(
"activemq.yaml",
"camel.yaml",
"hadoop.yaml",
"jetty.yaml",
"kafka-broker.yaml",

0 comments on commit 427fa2a

Please sign in to comment.