Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(components): add camel-observability-services #16277

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions bom/camel-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 5 additions & 0 deletions catalog/camel-allcomponents/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
46 changes: 46 additions & 0 deletions components/camel-observability-services/pom.xml
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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

|====
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion components/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
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";
davsclaus marked this conversation as resolved.
Show resolved Hide resolved
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";
Expand Down
1 change: 1 addition & 0 deletions docs/components/modules/others/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
9 changes: 7 additions & 2 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -1959,6 +1959,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>
Expand Down Expand Up @@ -2913,7 +2918,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>
Expand Down