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 Copiar enlaceEnlace copiado en el portapapeles!
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.
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 Copiar enlaceEnlace copiado en el portapapeles!
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>
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 Copiar enlaceEnlace copiado en el portapapeles!
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 Copiar enlaceEnlace copiado en el portapapeles!
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
Add the OpenTelemetry extension using the management CLI.
/extension=org.wildfly.extension.opentelemetry:addEnable the
opentelemetrysubsystem using the management CLI./subsystem=opentelemetry:addReload JBoss EAP.
reload
12.5. Configuring the opentelemetry subsystem Copiar enlaceEnlace copiado en el portapapeles!
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
-
You have enabled the
opentelemetrysubsystem. For more information, see Enabling OpenTelemetry tracing in JBoss EAP.
Procedure
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)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)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)