Este contenido no está disponible en el idioma seleccionado.

Chapter 5. Understand OpenTelemetry integration


OpenTelemetry integration in JBoss EAP provides observability and distributed tracing for applications. As an administrator or developer, you can monitor performance, trace requests across services, and better understand system behavior.

This integration uses the OpenTelemetry protocol and tools to track and analyze traces from incoming and outgoing requests, automatically tracing REST requests with minimal configuration. OpenTelemetry in JBoss EAP supports configuring exporters, span processors, and samplers, offering flexible tracing and exporting options. It also enables creating custom traces within user applications, enhancing observability in complex environments.

OpenTelemetry integration provides several key benefits:

  • Automatic tracing: REST requests are automatically traced, providing visibility into the system.
  • Customizable configuration: You can adjust tracing with support for exporters, span processors, and samplers.
  • Seamless context propagation: The trace context propagates across REST client calls for accurate end-to-end tracing.
  • Simplified monitoring: You can track performance and behavior without additional dependencies.

By configuring OpenTelemetry, you can improve application performance tracking, troubleshoot more effectively, and enhance system observability.

You can configure MicroProfile Reactive Messaging to trace messages in JBoss EAP, including incoming and outgoing messages over AMQP and Kafka connectors. Enable tracing by using the MicroProfile Reactive Messaging subsystem with the SmallRye Reactive Messaging connectors.

To enable tracing, adjust the subsystem settings along with the connector and channel configurations. These properties determine whether tracing is active, enabling you to track message flow and enhance observability and monitoring. Additionally, you can override some of this configuration by using any MicroProfile Config ConfigSource.

Ensure that the MicroProfile Telemetry subsystem is enabled. It delegates tracing to the OpenTelemetry subsystem, which contains the configuration for how tracing is performed.

5.1.1. MicroProfile Telemetry configuration for message tracing

MicroProfile Telemetry traces message flows in systems like Kafka and AMQP to improve monitoring and observability. By default, tracing is disabled in JBoss EAP and requires configuration of the MicroProfile Telemetry subsystem.

Tracing behavior is controlled by properties defined at various levels:

  • Channel-level properties: Provide granular control and override other settings. A channel refers to a specific messaging endpoint, such as from-kafka or to-amqp.
  • Connector-level properties: Used when no channel-level property is set.
  • Subsystem attributes: Used as the default when neither channel nor connector properties are defined.

The value for the connector attributes, such as kafka-connector and amqp-connector, in the subsystem configuration path at /subsystem=microprofile-reactive-messaging-smallrye/opentelemetry-tracing=config can be one of the following:

  • NEVER: Disables MicroProfile Telemetry tracing integration and prevents it from being enabled in deployed applications. This overrides any channel or connector-level properties that configure the tracing functionality. If the attribute is not set in the subsystem, NEVER is the default value.
  • OFF: Disables MicroProfile Telemetry tracing by default. You can enable it in applications by using MicroProfile Config properties for the deployment.
  • ON: Enables tracing by default. You can disable it in applications by using MicroProfile Config properties for the deployment.
  • ALWAYS: Enables MicroProfile Telemetry tracing integration and prevents it from being disabled in deployed applications. This overrides any channel or connector-level properties configuring the tracing functionality.

After configuring OpenTelemetry tracing, it integrates with the relevant connectors and channels to track message flow, such as through settings in the META-INF/microprofile-config.properties file.

5.1.1.1. Kafka connector tracing configuration

To enable tracing for Kafka connectors, configure the kafka-connector attribute at the subsystem level and set the relevant channel and connector properties:

  • Channel-level properties: Set mp.messaging.incoming.[channel-name].tracing-enabled to configure tracing for specific Kafka channels.
  • Connector-level properties: Set mp.messaging.connector.smallrye-kafka.tracing-enabled to configure tracing for all Kafka channels using the SmallRye Kafka connector.
  • Subsystem configuration: Configure the kafka-connector attribute to control tracing for Kafka channels.

For example, when the subsystem value is set to kafka-connector=OFF, the tracing behavior for each Kafka channel is as follows:

  • The incoming from-kafka channel will have tracing enabled because the mp.messaging.incoming.from-kafka.tracing-enabled property is set to true at the channel level, which overrides other settings. For example, the microprofile-config.properties file might include the following:

    mp.messaging.incoming.from-kafka.tracing-enabled=true
  • The outgoing to-kafka channel will not have tracing because no channel or connector configuration is set, and the kafka-connector attribute is set to OFF, which defaults to false.

If kafka-connector=ON is set, tracing is enabled by default for both Kafka channels. Tracing is enabled for both the incoming from-kafka and outgoing to-kafka channels based on their respective channel or connector-level properties.

5.1.1.2. AMQP Connector Tracing Configuration

To enable tracing for AMQP connectors, configure the amqp-connector attribute at the subsystem level and set the relevant channel and connector properties:

  • Channel-level properties: Set mp.messaging.incoming.[channel-name].tracing-enabled to configure tracing for specific AMQP channels.
  • Connector-level properties: Set mp.messaging.connector.smallrye-amqp.tracing-enabled to configure tracing for all AMQP channels using the SmallRye AMQP connector.
  • Subsystem configuration: Configure the amqp-connector attribute to control tracing for AMQP channels.

For example, when the subsystem value is set to amqp-connector=OFF, the tracing behavior for each channel is as follows:

  • The incoming from-amqp channel will not have tracing because the mp.messaging.incoming.from-amqp.tracing-enabled property is set to false, overriding other settings. For example, the microprofile-config.properties file might include the following:

    mp.messaging.incoming.from-amqp.tracing-enabled=false
  • The outgoing to-amqp channel will have tracing because it uses the connector-level setting mp.messaging.connector.smallrye-amqp.tracing-enabled, which is set to true. For example, to enable tracing for the incoming to-amqp channel, set:

    mp.messaging.outgoing.to-amqp.tracing-enabled=true

If amqp-connector=ON is set, tracing will be enabled for both AMQP channels by default. Tracing will be enabled for the outgoing to-amqp channel, while the incoming from-amqp channel will not have tracing because the mp.messaging.incoming.from-amqp.tracing-enabled property is set to false.

You can configure tracing for Kafka and AMQP connectors in JBoss EAP to track message flows and integrate with OpenTelemetry. This improves observability and simplifies performance diagnostics, making system monitoring and troubleshooting more effective.

Prerequisites

  • You have enabled the MicroProfile Telemetry subsystem, which delegates tracing to the OpenTelemetry subsystem. The OpenTelemetry subsystem manages tracing and configures the exporters and their endpoints.
  • You have installed and configured MicroProfile Reactive Messaging with the SmallRye Kafka and SmallRye AMQP connectors.
  • You have added the OpenTelemetry tracing configuration to the microprofile-reactive-messaging-smallrye subsystem.

Procedure

  1. Add the extension for MicroProfile Telemetry by using the following command:

    /extension=org.wildfly.extension.microprofile.telemetry:add
  2. Add the MicroProfile Telemetry subsystem by using the following command:

    /subsystem=microprofile-telemetry:add
  3. Add the OpenTelemetry tracing configuration to the MicroProfile Reactive Messaging subsystem by using the following command:

    /subsystem=microprofile-reactive-messaging-smallrye/opentelemetry-tracing=config:add
  4. Configure the tracing settings for the Kafka and AMQP connectors at the connector level by using the following commands:

    • For Kafka configuration:

      /subsystem=microprofile-reactive-messaging-smallrye/opentelemetry-tracing=config:write-attribute(name=kafka-connector, value=ON)
    • For AMQP configuration:

      /subsystem=microprofile-reactive-messaging-smallrye/opentelemetry-tracing=config:write-attribute(name=amqp-connector, value=ON)
  5. Enable MicroProfile Telemetry tracing for your application by setting the MicroProfile Config property to false, as tracing is disabled by default. Add the following property to the META-INF/microprofile-config.properties file:

    otel.sdk.disabled=false
  6. Set tracing for individual incoming and outgoing channels by configuring the META-INF/microprofile-config.properties file as follows:

    • For Kafka Channels:

      Enable tracing for the incoming channel:

      mp.messaging.incoming.from-kafka.tracing-enabled=true

      Enable tracing for the outgoing channel:

      mp.messaging.outgoing.to-kafka.tracing-enabled=true
    • For AMQP Channels:

      Disable tracing for the incoming channel:

      mp.messaging.incoming.from-amqp.tracing-enabled=false

      Enable tracing for the outgoing channel:

      mp.messaging.outgoing.to-amqp.tracing-enabled=true
  7. Add the following properties in the META-INF/microprofile-config.properties file to enable tracing for the entire application at the connector level:

    • For the AMQP connector:

      mp.messaging.connector.smallrye-amqp.tracing-enabled=true

      For the Kafka connector:

      mp.messaging.connector.smallrye-kafka.tracing-enabled=true

Tracing will be enabled for both Kafka and AMQP connectors in JBoss EAP. For a complete example of configuring both an AMQP connector and a Kafka connector, see Example for configuring an AMQP connector and a Kafka connector.

5.3. Example for configuring an AMQP connector and a Kafka connector

Refer to the following complete example of a microprofile-config.properties file that configures both an AMQP connector and a Kafka connector, including tracing configuration for both connectors with the values:

# Global AMQP settings
amqp-host=localhost
amqp-port=5672
amqp-username=artemis
amqp-password=artemis
mp.messaging.connector.smallrye-amqp.tracing-enabled=true

# Global Kafka settings
kafka.bootstrap.servers=localhost:9990

# Setting needed to allow MicroProfile Telemetry for the application
otel.sdk.disabled=false

# Less MP Telemetry output
otel.metrics.exporter=none
otel.logs.exporter=none

# Settings for the 'to-kafka' and 'from-kafka' channels
mp.messaging.outgoing.to-kafka.connector=smallrye-kafka
mp.messaging.outgoing.to-kafka.topic=testkafka
mp.messaging.outgoing.to-kafka.value.serializer=org.apache.kafka.common.serialization.StringSerializer

mp.messaging.incoming.from-kafka.connector=smallrye-kafka
mp.messaging.incoming.from-kafka.topic=testkafka
mp.messaging.incoming.from-kafka.value.deserializer=org.apache.kafka.common.serialization.StringDeserializer
mp.messaging.outgoing.from-kafka.tracing-enabled=true

# Settings for the 'to-amqp' and 'from-amqp' channels
mp.messaging.outgoing.to-amqp.connector=smallrye-amqp
mp.messaging.outgoing.to-amqp.address=testamqp

mp.messaging.incoming.from-amqp.connector=smallrye-amqp
mp.messaging.incoming.from-amqp.address=testamqp
mp.messaging.outgoing.from-amqp.tracing-enabled=false
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2026 Red Hat
Volver arriba