This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 2242d7742068 feat(observability): default logging metrics on shutdown
2242d7742068 is described below
commit 2242d77420682fed960b885f08e6dd63dc88c5aa
Author: Pasquale Congiusti <[email protected]>
AuthorDate: Tue Mar 3 09:07:30 2026 +0100
feat(observability): default logging metrics on shutdown
---
.../src/main/docs/observability-services.adoc | 12 ++++++++++--
.../src/main/resources/observability-services.properties | 2 ++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git
a/components/camel-observability-services/src/main/docs/observability-services.adoc
b/components/camel-observability-services/src/main/docs/observability-services.adoc
index ba73bee1faac..4c8b7a163233 100644
---
a/components/camel-observability-services/src/main/docs/observability-services.adoc
+++
b/components/camel-observability-services/src/main/docs/observability-services.adoc
@@ -13,7 +13,7 @@ The Camel Observability Services provide services for
observing the state of Cam
== What is observability?
-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.
+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.
There are 4 different types of observability:
@@ -22,7 +22,7 @@ There are 4 different types of observability:
3. Tracing (Follows the path of a message as it moves through routes.)
4. Logging (Records of events happening in Camel.)
-Camel Observability services unifies all the different types of observability,
and provides standardized endpoints for each.
+Camel Observability services unifies all the different types of observability,
and provides standardized endpoints for each.
== Usage
@@ -76,6 +76,14 @@ If you need to customize each of the different components
provided within this s
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.
+== Default logging metrics on shutdown
+
+NOTE: feature available since version 4.19.0
+
+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 [...]
+
+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.
+
=== OpenTelemetry configuration
The presence of this component will provide the required instrumentation to
easily enable the collection of OpenTelemetry metrics.
diff --git
a/components/camel-observability-services/src/main/resources/observability-services.properties
b/components/camel-observability-services/src/main/resources/observability-services.properties
index 614b57a73b05..ea7ba81ef774 100644
---
a/components/camel-observability-services/src/main/resources/observability-services.properties
+++
b/components/camel-observability-services/src/main/resources/observability-services.properties
@@ -24,5 +24,7 @@ camel.management.healthPath=/observe/health
camel.health.exposure-level=full
camel.metrics.enabled=true
camel.metrics.path=/observe/metrics
+camel.metrics.logMetricsOnShutdown=true
+camel.metrics.logMetricsOnShutdownFilters=app.info,camel.exchanges.*
# Opentelemetry
camel.opentelemetry2.enabled=true