Skip to content

Commit 2242d77

Browse files
committed
feat(observability): default logging metrics on shutdown
1 parent 29375d7 commit 2242d77

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

components/camel-observability-services/src/main/docs/observability-services.adoc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The Camel Observability Services provide services for observing the state of Cam
1313

1414
== What is observability?
1515

16-
Modern systems (especially distributed ones like Camel) are complex. When something breaks or slows down, you need visibility into what's happening inside without manually digging into every part. Observability gives you that visibility.
16+
Modern systems (especially distributed ones like Camel) are complex. When something breaks or slows down, you need visibility into what's happening inside without manually digging into every part. Observability gives you that visibility.
1717

1818
There are 4 different types of observability:
1919

@@ -22,7 +22,7 @@ There are 4 different types of observability:
2222
3. Tracing (Follows the path of a message as it moves through routes.)
2323
4. Logging (Records of events happening in Camel.)
2424

25-
Camel Observability services unifies all the different types of observability, and provides standardized endpoints for each.
25+
Camel Observability services unifies all the different types of observability, and provides standardized endpoints for each.
2626

2727
== Usage
2828

@@ -76,6 +76,14 @@ If you need to customize each of the different components provided within this s
7676

7777
WARNING: The customization of the configuration for this component is not available for Spring Boot runtime due to a https://github.com/spring-projects/spring-boot/issues/24688[known limitation]. You can use this component in Spring Boot runtime with the default settings only. If you need to provide any customization, you'll need to configure each component separately.
7878

79+
== Default logging metrics on shutdown
80+
81+
NOTE: feature available since version 4.19.0
82+
83+
The presence of this component will make sure that when the application is shutting down, certain metrics are stored on log of the application in order to be preserved for any future analysis or shared with your log aggregator. This could be a solution to investigate how many exchanges were processed, how many have failed, etc, on an application that has a sudden or even a controlled shutdown. You can think on a cronjob running and being able at any moment to learn certain stats without the need to have your application running to scrape the `/metrics` endpoint.
84+
85+
You can even change `camel.metrics.logMetricsOnShutdown` and `camel.metrics.logMetricsOnShutdownFilters` in order to qualify better this behavior, which defaults to `true` and `app.info,camel.exchanges.*` by default.
86+
7987
=== OpenTelemetry configuration
8088

8189
The presence of this component will provide the required instrumentation to easily enable the collection of OpenTelemetry metrics.

components/camel-observability-services/src/main/resources/observability-services.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ camel.management.healthPath=/observe/health
2424
camel.health.exposure-level=full
2525
camel.metrics.enabled=true
2626
camel.metrics.path=/observe/metrics
27+
camel.metrics.logMetricsOnShutdown=true
28+
camel.metrics.logMetricsOnShutdownFilters=app.info,camel.exchanges.*
2729
# Opentelemetry
2830
camel.opentelemetry2.enabled=true

0 commit comments

Comments
 (0)