Skip to content

Commit

Permalink
feat(extension): onboard Observability Services
Browse files Browse the repository at this point in the history
Closes #6790
  • Loading branch information
squakez authored and jamesnetherton committed Jan 23, 2025
1 parent 9cdddff commit bc8e373
Show file tree
Hide file tree
Showing 23 changed files with 867 additions and 0 deletions.
13 changes: 13 additions & 0 deletions catalog/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2866,6 +2866,19 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-observability-services</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-ognl</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions docs/modules/ROOT/examples/others/observability-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Do not edit directly!
# This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
cqArtifactId: camel-quarkus-observability-services
cqArtifactIdBase: observability-services
cqNativeSupported: true
cqStatus: Stable
cqDeprecated: false
cqJvmSince: 3.18.0
cqNativeSince: 3.18.0
cqCamelPartName: observability-services
cqCamelPartTitle: Observability Services
cqCamelPartDescription: Camel Observability Services
cqExtensionPageTitle: Observability Services
1 change: 1 addition & 0 deletions docs/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
*** xref:reference/extensions/nitrite.adoc[Nitrite]
*** xref:reference/extensions/oaipmh.adoc[OAI-PMH]
*** xref:reference/extensions/ognl.adoc[OGNL]
*** xref:reference/extensions/observability-services.adoc[Observability Services]
*** xref:reference/extensions/olingo4.adoc[Olingo4]
*** xref:reference/extensions/openapi-java.adoc[OpenAPI Java]
*** xref:reference/extensions/opensearch.adoc[OpenSearch]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-observability-services"]
= Observability Services
:linkattrs:
:cq-artifact-id: camel-quarkus-observability-services
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Camel Observability Services
:cq-deprecated: false
:cq-jvm-since: 3.19.0
:cq-native-since: 3.19.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##3.19.0## [.badge-key]##Native since##[.badge-supported]##3.19.0##
endif::[]

Camel Observability Services

[id="extensions-observability-services-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-observability-services[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-observability-services</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-observability-services-usage"]
== Usage
This extension is used to 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.

All you need to do is to add the 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 */observe/<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.

[id="extensions-observability-services-usage-components"]
== Components

The presence of this dependency will provide the following extensions:

* Camel Quarkus MicroProfile Health - for health checks
* Camel Quarkus Management - for JMX
* Camel Quarkus Micrometer - for Camel Micrometer metrics
* Camel Quarkus OpenTelemetry - for tracing Camel messages (events/spans)
* Quarkus Micrometer Registry Prometheus - for exporting metrics in Prometheus format

[id="extensions-observability-services-usage-list-of-known-endpoints"]
=== List of known endpoints

The presence of this dependency will expose the following endpoints:

|====
|Endpoint | Description

| `/observe/health` | startup probe endpoint
| `/observe/health/live` | liveness probe endpoint
| `/observe/health/ready` | readiness probe endpoint
| `/observe/metrics` | metrics exposed as in Micrometer Prometheus Registry

|====

NOTE: You can configure the endpoints as you'd do normally within each extension configuration.

[id="extensions-observability-services-usage-opentelemetry-configuration"]
== OpenTelemetry configuration

The presence of this component will provide the required instrumentation to easily enable the collection of Opentelemetry metrics. The Camel Quarkus Opentelemetry extension instrument your application with a service which periodically pushes OTEL traces to the collector. This is disabled by default in order to prevent the application to push traces when no telemetry server is available.

In order to turn it on, you need to specify the following configuration explicitly:

```
quarkus.otel.sdk.disabled=false
```

Beside that, you can change any further parameter, like, for instance, the server where to push the traces (default, `http://localhost:4317`)

```
quarkus.otel.exporter.otlp.traces.endpoint=http://my-otel-collector.svc:4317
```

NOTE: Quarkus runtime defaults to gRPC protocol (port 4317).

[id="extensions-observability-services-usage-jmx-configuration"]
== JMX configuration

The presence of this component implies the presence of `camel-management` component. This is in charge to include information about Camel application status in JMX format.

NOTE: The presence of this components automatically enable the collection of the JMX metrics. This should be negligible from performance point of view, however, you may want to disable that running the application with `-Dorg.apache.camel.jmx.disabled=true` JVM option.


83 changes: 83 additions & 0 deletions extensions/observability-services/deployment/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-observability-services-parent</artifactId>
<version>3.19.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-observability-services-deployment</artifactId>
<name>Camel Quarkus :: Observability Services :: Deployment</name>

<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-core-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-observability-services</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-micrometer-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-micrometer-registry-prometheus-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-microprofile-health-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-opentelemetry-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-management-deployment</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-processor</artifactId>
<version>${quarkus.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* 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.
*/
package org.apache.camel.quarkus.component.observabilityservices.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;

class ObservabilityServicesProcessor {

private static final String FEATURE = "camel-observability-services";

@BuildStep
FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}
}
39 changes: 39 additions & 0 deletions extensions/observability-services/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-extensions</artifactId>
<version>3.19.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>camel-quarkus-observability-services-parent</artifactId>
<name>Camel Quarkus :: Observability Services</name>
<packaging>pom</packaging>

<modules>
<module>deployment</module>
<module>runtime</module>
</modules>
</project>
Loading

0 comments on commit bc8e373

Please sign in to comment.