OpenTelemetry

Stable • Since 2.7.0

Generate OpenTelemetry traces.

OpenTelemetry Metrics and Logging are not supported yet on neither Quarkus nor CXF side, hence Quarkus CXF cannot support them either. Tracing is thus the only OpenTelemetry feature supported by this extension.

Maven coordinates

Create a new project using quarkus-cxf-integration-tracing-opentelemetry on code.quarkus.io or add these coordinates to your existing project:

<dependency>
    <groupId>io.quarkiverse.cxf</groupId>
    <artifactId>quarkus-cxf-integration-tracing-opentelemetry</artifactId>
</dependency>

Check the User guide and especially its Dependency management section for more information about writing applications with Quarkus CXF.

Usage

This extension builds on top of org.apache.cxf.tracing.opentelemetry.OpenTelemetryFeature (for service endpoints) and org.apache.cxf.tracing.opentelemetry.OpenTelemetryClientFeature (for clients). Instances of these are created and configured internally using the instance of io.opentelemetry.api.OpenTelemetry provided by Quarkus OpenTelemetry.

The tracing is enabled by default for all clients and service endpoints created by Quarkus CXF, unless you disable it explicitly via quarkus.cxf.otel.enabled-for, quarkus.cxf.client."client-name".otel.enabled or quarkus.cxf.endpoint."/endpoint-path".otel.enabled.

Runnable example

There is an integration test covering OpenTelemetry in the Quarkus CXF source tree. It is using InMemorySpanExporter from io.opentelemetry:opentelemetry-sdk-testing, so that the spans can be inspected from tests easily. Refer to Quarkus OpenTelemetry guide for information about other supported span exporters and collectors.

Configuration

Configuration property fixed at build time. All other configuration properties are overridable at runtime.

Configuration property Type Default

quarkus.cxf.otel.enabled-for

clients, services, both, none

both

Specifies whether the OpenTelemetry tracing will be enabled for clients, services, both or none. This global setting can be overridden per client or service endpoint using the quarkus.cxf.client."client-name".otel.enabled or quarkus.cxf.endpoint."/endpoint-path".otel.enabled option respectively.

Environment variable: QUARKUS_CXF_OTEL_ENABLED_FOR
Since Quarkus CXF: 2.7.0

quarkus.cxf.client."client-name".otel.enabled

boolean

true

If true and if quarkus.cxf.otel.enabled-for is set to both or clients then the OpenTelemetryClientFeature will be added to this client; otherwise the feature will not be added to this client.

Environment variable: QUARKUS_CXF_CLIENT__CLIENT_NAME__OTEL_ENABLED
Since Quarkus CXF: 2.7.0

quarkus.cxf.endpoint."/endpoint-path".otel.enabled

boolean

true

If true and if quarkus.cxf.otel.enabled-for is set to both or services then the OpenTelemetryFeature will be added to this service endpoint; otherwise the feature will not be added to this service endpoint.

Environment variable: QUARKUS_CXF_ENDPOINT___ENDPOINT_PATH__OTEL_ENABLED
Since Quarkus CXF: 2.7.0