-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(extension): onboard Observability Services
Closes #6790
- Loading branch information
Showing
26 changed files
with
1,135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
docs/modules/ROOT/examples/others/observability-services.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
docs/modules/ROOT/pages/reference/extensions/observability-services.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// 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.18.0 | ||
:cq-native-since: 3.18.0 | ||
|
||
ifeval::[{doc-show-badges} == true] | ||
[.badges] | ||
[.badge-key]##JVM since##[.badge-supported]##3.18.0## [.badge-key]##Native since##[.badge-supported]##3.18.0## | ||
endif::[] | ||
|
||
Camel Observability Services | ||
|
||
[id="extensions-observability-services-whats-inside"] | ||
== What's inside | ||
|
||
* xref:{cq-camel-components}:others:observability-services.adoc[Observability Services] | ||
|
||
Please refer to the above link for usage and configuration details. | ||
|
||
[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 | ||
* Camel Quarkus Management | ||
* Camel Quarkus Micrometer | ||
* Camel Quarkus OpenTelemetry | ||
* Quarkus Micrometer Registry Prometheus | ||
|
||
[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. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?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.18.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> | ||
|
||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-junit5-internal</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-security-deployment</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.quarkus</groupId> | ||
<artifactId>quarkus-vertx-http</artifactId> | ||
<scope>test</scope> | ||
</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> |
30 changes: 30 additions & 0 deletions
30
...el/quarkus/component/observabilityservices/deployment/ObservabilityServicesProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
...mel/quarkus/component/observabilityservices/deployment/MicroProfileHealthEnabledTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* 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.test.QuarkusUnitTest; | ||
import jakarta.inject.Inject; | ||
import org.apache.camel.CamelContext; | ||
import org.apache.camel.health.HealthCheckRegistry; | ||
import org.apache.camel.impl.health.ConsumersHealthCheckRepository; | ||
import org.apache.camel.impl.health.ContextHealthCheck; | ||
import org.apache.camel.impl.health.RoutesHealthCheckRepository; | ||
import org.apache.camel.microprofile.health.CamelMicroProfileHealthCheckRegistry; | ||
import org.jboss.shrinkwrap.api.ShrinkWrap; | ||
import org.jboss.shrinkwrap.api.spec.JavaArchive; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.extension.RegisterExtension; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class MicroProfileHealthEnabledTest { | ||
|
||
@RegisterExtension | ||
static final QuarkusUnitTest CONFIG = new QuarkusUnitTest() | ||
.setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)); | ||
|
||
@Inject | ||
CamelContext context; | ||
|
||
@Test | ||
public void healthCheckRegistryNotNull() { | ||
HealthCheckRegistry registry = HealthCheckRegistry.get(context); | ||
assertNotNull(registry); | ||
assertTrue(registry instanceof CamelMicroProfileHealthCheckRegistry); | ||
assertEquals("camel-microprofile-health", registry.getId()); | ||
} | ||
|
||
@Test | ||
public void contextHealthCheckNotNull() { | ||
ContextHealthCheck contextHealthCheck = context.getRegistry().lookupByNameAndType("context", ContextHealthCheck.class); | ||
assertNotNull(contextHealthCheck); | ||
} | ||
|
||
@Test | ||
public void routesHealthCheckNotNull() { | ||
RoutesHealthCheckRepository routesRepository = context.getRegistry().lookupByNameAndType("routes", | ||
RoutesHealthCheckRepository.class); | ||
assertNotNull(routesRepository); | ||
} | ||
|
||
@Test | ||
public void consumersHealthCheckNotNull() { | ||
ConsumersHealthCheckRepository consumersRepository = context.getRegistry().lookupByNameAndType("consumers", | ||
ConsumersHealthCheckRepository.class); | ||
assertNotNull(consumersRepository); | ||
} | ||
} |
Oops, something went wrong.