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 88baf2273c5 feat(components): add camel-observability-services
88baf2273c5 is described below

commit 88baf2273c5f320317e4bc828268a67c66bd46cf
Author: Pasquale Congiusti <pasquale.congiu...@gmail.com>
AuthorDate: Thu Nov 14 12:29:51 2024 +0100

    feat(components): add camel-observability-services
    
    Closes CAMEL-21384
---
 bom/camel-bom/pom.xml                              |  5 +++
 catalog/camel-allcomponents/pom.xml                |  5 +++
 components/camel-observability-services/pom.xml    | 46 ++++++++++++++++++++++
 .../src/main/docs/observability-services.adoc      | 39 ++++++++++++++++++
 .../resources/observability-services.properties    | 21 ++++++++++
 components/pom.xml                                 |  4 +-
 .../org/apache/camel/main/BaseMainSupport.java     |  4 +-
 .../java/org/apache/camel/main/MainConstants.java  |  2 +
 docs/components/modules/others/nav.adoc            |  1 +
 .../others/pages/observability-services.adoc       |  1 +
 parent/pom.xml                                     |  9 ++++-
 11 files changed, 133 insertions(+), 4 deletions(-)

diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 76070c7d72d..98040001f20 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -1512,6 +1512,11 @@
         <artifactId>camel-oaipmh</artifactId>
         <version>4.9.0-SNAPSHOT</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-observability-services</artifactId>
+        <version>4.9.0-SNAPSHOT</version>
+      </dependency>
       <dependency>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-observation</artifactId>
diff --git a/catalog/camel-allcomponents/pom.xml 
b/catalog/camel-allcomponents/pom.xml
index b2a24b6b6df..c7298fa6295 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -1326,6 +1326,11 @@
             <artifactId>camel-oaipmh</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-observability-services</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-observation</artifactId>
diff --git a/components/camel-observability-services/pom.xml 
b/components/camel-observability-services/pom.xml
new file mode 100644
index 00000000000..3e3fd3b81e5
--- /dev/null
+++ b/components/camel-observability-services/pom.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>components</artifactId>
+        <version>4.9.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-observability-services</artifactId>
+    <packaging>jar</packaging>
+    <name>Camel :: Observability Services</name>
+    <description>Camel Observability Services for Camel Main</description>
+
+    <properties>
+        <firstVersion>4.9.0</firstVersion>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-micrometer-prometheus</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git 
a/components/camel-observability-services/src/main/docs/observability-services.adoc
 
b/components/camel-observability-services/src/main/docs/observability-services.adoc
new file mode 100644
index 00000000000..94905c82551
--- /dev/null
+++ 
b/components/camel-observability-services/src/main/docs/observability-services.adoc
@@ -0,0 +1,39 @@
+= Observability Services Component
+:doctitle: Observability Services
+:shortname: observability-services
+:artifactid: camel-observability-services
+:description: Camel Observability Services for Camel Main
+:since: 4.9
+:supportlevel: Stable
+:tabs-sync-option:
+
+*Since Camel {since}*
+
+The Camel Observability Services component is used to run Camel standalone 
(Camel Main) and provide a set of opinionated components and configuration 
which simplify operations such as observability on cloud environments. Although 
the component is mainly targeted for cloud, it can be used in any other 
environment, giving to the Camel application the capability to expose a set of 
observability features by default.
+
+== Usage
+
+=== Auto-detection from classpath
+
+All you need to do is to add the `camel-observability-services` dependency to 
the classpath. There's no need to add any further configuration. Each 
individual component will be configured using each own default settings except 
the endpoint which will be exposed in `/camel/<service>` by default.
+
+If you need to customize each of the different components provided within this 
service, then, you can specify in the `application.properties` each of the 
configuration as it would be done normally when you provide the individual 
component.
+
+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 provide each 
component and configuration accordingly.
+
+== Components available
+
+The presence of this dependency will provide the following components:
+
+* camel-micrometer-prometheus
+
+=== List of known endpoints
+
+The presence of this dependency will expose the following endpoints:
+
+|====
+|Endpoint | Description
+
+| `/camel/metrics` | metrics exposed as in Micrometer Prometheus Registry
+
+|====
diff --git 
a/components/camel-observability-services/src/main/resources/observability-services.properties
 
b/components/camel-observability-services/src/main/resources/observability-services.properties
new file mode 100644
index 00000000000..01a3c5a8139
--- /dev/null
+++ 
b/components/camel-observability-services/src/main/resources/observability-services.properties
@@ -0,0 +1,21 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements.  See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License.  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+camel.server.enabled=true
+camel.server.metricsEnabled=true
+camel.metrics.enabled=true
+# Default metrics endpoint
+camel.metrics.path=/camel/metrics
\ No newline at end of file
diff --git a/components/pom.xml b/components/pom.xml
index 60e932d39b8..a27c356df0e 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -278,7 +278,7 @@
         <module>camel-snakeyaml</module>
         <module>camel-snmp</module>
         <module>camel-soap</module>
-        <module>camel-solr</module>        
+        <module>camel-solr</module>
         <module>camel-splunk</module>
         <module>camel-splunk-hec</module>
         <module>camel-spring-batch</module>
@@ -337,6 +337,8 @@
         <module>camel-rest-openapi</module>
         <!-- build jooq last as it cause component builds to be slower 
afterwards -->
         <module>camel-jooq</module>
+        <!-- observability-services requires the availability of other 
components -->
+        <module>camel-observability-services</module>
     </modules>
 
     <properties>
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java 
b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
index 109877699da..5cb6c674e3f 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/BaseMainSupport.java
@@ -145,7 +145,9 @@ public abstract class BaseMainSupport extends BaseService {
     protected final OrderedLocationProperties wildcardProperties = new 
OrderedLocationProperties();
     protected RoutesCollector routesCollector = new DefaultRoutesCollector();
     protected String propertyPlaceholderLocations;
-    protected String defaultPropertyPlaceholderLocation = 
MainConstants.DEFAULT_PROPERTY_PLACEHOLDER_LOCATION;
+    protected String defaultPropertyPlaceholderLocation
+            = MainConstants.DEFAULT_PROPERTY_PLACEHOLDER_LOCATION + ","
+              + MainConstants.DEFAULT_OBSERVABILITY_SERVICES_PROPERTY_LOCATION;
     protected Properties initialProperties;
     protected Properties overrideProperties;
     protected boolean standalone = true;
diff --git 
a/core/camel-main/src/main/java/org/apache/camel/main/MainConstants.java 
b/core/camel-main/src/main/java/org/apache/camel/main/MainConstants.java
index 0304faa0ace..03d7d7ab360 100644
--- a/core/camel-main/src/main/java/org/apache/camel/main/MainConstants.java
+++ b/core/camel-main/src/main/java/org/apache/camel/main/MainConstants.java
@@ -19,6 +19,8 @@ package org.apache.camel.main;
 public final class MainConstants {
 
     public static final String DEFAULT_PROPERTY_PLACEHOLDER_LOCATION = 
"classpath:application.properties;optional=true";
+    public static final String DEFAULT_OBSERVABILITY_SERVICES_PROPERTY_LOCATION
+            = "classpath:observability-services.properties;optional=true";
     public static final String INITIAL_PROPERTIES_LOCATION = 
"camel.main.initial-properties-location";
     public static final String OVERRIDE_PROPERTIES_LOCATION = 
"camel.main.override-properties-location";
     public static final String CLOUD_PROPERTIES_LOCATION = 
"camel.main.cloud-properties-location";
diff --git a/docs/components/modules/others/nav.adoc 
b/docs/components/modules/others/nav.adoc
index a7f99a4b867..7b83d163074 100644
--- a/docs/components/modules/others/nav.adoc
+++ b/docs/components/modules/others/nav.adoc
@@ -32,6 +32,7 @@
 ** xref:microprofile-config.adoc[Microprofile Config]
 ** xref:microprofile-fault-tolerance.adoc[Microprofile Fault Tolerance]
 ** xref:microprofile-health.adoc[Microprofile Health]
+** xref:observability-services.adoc[Observability Services]
 ** xref:openapi-java.adoc[Openapi Java]
 ** xref:openapi-validator.adoc[Openapi Validator]
 ** xref:opentelemetry.adoc[OpenTelemetry]
diff --git a/docs/components/modules/others/pages/observability-services.adoc 
b/docs/components/modules/others/pages/observability-services.adoc
new file mode 120000
index 00000000000..20cedd768e9
--- /dev/null
+++ b/docs/components/modules/others/pages/observability-services.adoc
@@ -0,0 +1 @@
+../../../../../components/camel-observability-services/src/main/docs/observability-services.adoc
\ No newline at end of file
diff --git a/parent/pom.xml b/parent/pom.xml
index 2d543af76bf..84bfc24a610 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -275,7 +275,7 @@
         <jedis-client-version>5.2.0</jedis-client-version>
         <jetcd-version>0.8.3</jetcd-version>
         <jetty-version>12.0.15</jetty-version>
-        <jetty-for-solr-version>10.0.20</jetty-for-solr-version>        
+        <jetty-for-solr-version>10.0.20</jetty-for-solr-version>
         <jetty-plugin-version>${jetty-version}</jetty-plugin-version>
         <jetty-runner-groupId>org.eclipse.jetty</jetty-runner-groupId>
         <jettison-version>1.5.4</jettison-version>
@@ -1958,6 +1958,11 @@
                 <artifactId>camel-oaipmh</artifactId>
                 <version>${project.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.apache.camel</groupId>
+                <artifactId>camel-observability-services</artifactId>
+                <version>${project.version}</version>
+            </dependency>
             <dependency>
                 <groupId>org.apache.camel</groupId>
                 <artifactId>camel-observation</artifactId>
@@ -2912,7 +2917,7 @@
             If we import the grpc-bom, we get a lot of duplicate dependencies
             and conflicts between BOMs.  The only way is to manually manage
             those dependencies.
-            
+
             <dependency>
                 <groupId>io.grpc</groupId>
                 <artifactId>grpc-bom</artifactId>

Reply via email to