Este contenido no está disponible en el idioma seleccionado.

Chapter 12. 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.

12.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.

Warning

Although OpenTelemetry is no longer considered Technology Preview, users should be aware that upstream development is still ongoing. This may cause your observability dashboards to malfunction when newer versions of OpenTelemetry are released.

12.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>
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>.

12.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.

12.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.1 with JBoss EAP XP 6.0 is installed.

Procedure

  1. Add the OpenTelemetry extension using the management CLI.

    /extension=org.wildfly.extension.opentelemetry:add
  2. Enable the opentelemetry subsystem using the management CLI.

    /subsystem=opentelemetry:add
  3. Reload JBoss EAP.

    reload

12.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>)

    Example

    /subsystem=opentelemetry:write-attribute(name=exporter-type, value=otlp)
  2. Set the endpoint at which to export the traces.

    Syntax

    /subsystem=opentelemetry:write-attribute(name=endpoint, value=<URL:port>)

    Example

    /subsystem=opentelemetry:write-attribute(name=endpoint, value=http://localhost:4317)
  3. Set the service name under which the traces are exported.

    Syntax

    /subsystem=opentelemetry:write-attribute(name=service-name, value=<service_name>)

    Example

    /subsystem=opentelemetry:write-attribute(name=service-name, value=exampleOpenTelemetryService)
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