Este contenido no está disponible en el idioma seleccionado.

Chapter 13. Observability in JBoss EAP


If you’re a developer or system administrator, observability is a set of practices and technologies you can use to determine, based on certain signals from your application, the location and source of a problem in your application. The most common signals are metrics, events, and tracing. JBoss EAP uses OpenTelemetry for observability.

13.1. OpenTelemetry in JBoss EAP

OpenTelemetry is a set of tools, application programming interfaces (APIs), and software development kits (SDKs) you can use to instrument, generate, collect, and export telemetry data for your applications. Telemetry data includes metrics, logs, and traces. Analyzing an application’s telemetry data helps you to improve your application’s performance. JBoss EAP provides OpenTelemetry capability through the opentelemetry subsystem.

Note

Red Hat JBoss Enterprise Application Platform 8.0 provides only OpenTelemetry tracing capabilities.

Important

OpenTelemetry is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview .

13.2. OpenTelemetry configuration in JBoss EAP

You configure a number of aspects of OpenTelemetry in JBoss EAP using the opentelemetry subsystem. These include exporter, span processor, and sampler.

exporter
To analyze and visualize traces, you export them to a collector such as the OpenTelemetry Collector (OTLP). You can configure JBoss EAP to use any collector that supports the OpenTelemetry protocol.
span processor
You can configure the span processor to export spans either as they are produced or in batches. You can also configure the number of traces to export.
sampler
You can configure the number of traces to record by configuring the sampler.

Example configuration

The following XML is an example of the full OpenTelemetry configuration, including default values. JBoss EAP does not persist the default values when you make changes, so your configuration might look different.

<subsystem xmlns="urn:wildfly:opentelemetry:1.0"
        service-name="example">
    <exporter
        type="otlp"
        endpoint="http://localhost:4317"/>
    <span-processor
        type="batch"
        batch-delay="4500"
        max-queue-size="128"
        max-export-batch-size="512"
        export-timeout="45"/>
    <sampler
        type="on"/>
</subsystem>
Copy to Clipboard Toggle word wrap
Note

You cannot use an OpenShift route object to connect with a OpenTelemetry Collector endpoint. Instead, use http://<ip_address>:<port> or http://<service_name>:<port>.

13.3. OpenTelemetry tracing in JBoss EAP

JBoss EAP provides OpenTelemetry tracing to help you track the progress of user requests as they pass through different parts of your application. By analyzing traces, you can improve your application’s performance and debug availability issues.

OpenTelemetry tracing consists of the following components:

Trace
A collection of operations that a request goes through in an application.
Span
A single operation within a trace. It provides request, error, and duration (RED) metrics and contains a span context.
Span context
A set of unique identifiers that represents a request that the containing span is a part of.

JBoss EAP automatically traces REST calls to your Jakarta RESTful Web Services applications and container-managed Jakarta RESTful Web Services client invocations. JBoss EAP traces REST calls implicitly as follows:

  • For each incoming request:

    • JBoss EAP extracts the span context from the request.
    • JBoss EAP starts a new span, then closes it when the request is completed.
  • For each outgoing request:

    • JBoss EAP injects span context into the request.
    • JBoss EAP starts a new span, then closes it when the request is completed.

In addition to implicit tracing, you can create custom spans by injecting a Tracer instance into your application for granular tracing.

13.4. Enabling OpenTelemetry tracing in JBoss EAP

To use OpenTelemetry tracing in JBoss EAP you must first enable the opentelemetry subsystem.

Prerequisites

  • JBoss EAP 8.0 with JBoss EAP XP 5.0 is installed.

Procedure

  1. Add the OpenTelemetry extension using the management CLI.

    /extension=org.wildfly.extension.opentelemetry:add
    Copy to Clipboard Toggle word wrap
  2. Enable the opentelemetry subsystem using the management CLI.

    /subsystem=opentelemetry:add
    Copy to Clipboard Toggle word wrap
  3. Reload JBoss EAP.

    reload
    Copy to Clipboard Toggle word wrap

13.5. Configuring the opentelemetry subsystem

You can configure the opentelemetry subsystem to set different aspects of tracing. Configure these based on the collector you use for observing the traces.

Prerequisites

Procedure

  1. Set the exporter type for the traces.

    Syntax

    /subsystem=opentelemetry:write-attribute(name=exporter-type, value=<exporter_type>)
    Copy to Clipboard Toggle word wrap

    Example

    /subsystem=opentelemetry:write-attribute(name=exporter-type, value=otlp)
    Copy to Clipboard Toggle word wrap

  2. Set the endpoint at which to export the traces.

    Syntax

    /subsystem=opentelemetry:write-attribute(name=endpoint, value=<URL:port>)
    Copy to Clipboard Toggle word wrap

    Example

    /subsystem=opentelemetry:write-attribute(name=endpoint, value=http://localhost:4317)
    Copy to Clipboard Toggle word wrap

  3. Set the service name under which the traces are exported.

    Syntax

    /subsystem=opentelemetry:write-attribute(name=service-name, value=<service_name>)
    Copy to Clipboard Toggle word wrap

    Example

    /subsystem=opentelemetry:write-attribute(name=service-name, value=exampleOpenTelemetryService)
    Copy to Clipboard Toggle word wrap

Volver arriba
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

© 2025 Red Hat