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 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.
Red Hat JBoss Enterprise Application Platform 8.0 provides only OpenTelemetry tracing capabilities.
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 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.
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 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.
13.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.0 with JBoss EAP XP 5.0 is installed.
Procedure
Add the OpenTelemetry extension using the management CLI.
/extension=org.wildfly.extension.opentelemetry:add
/extension=org.wildfly.extension.opentelemetry:addCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the
opentelemetrysubsystem using the management CLI./subsystem=opentelemetry:add
/subsystem=opentelemetry:addCopy to Clipboard Copied! Toggle word wrap Toggle overflow Reload JBoss EAP.
reload
reloadCopy to Clipboard Copied! Toggle word wrap Toggle overflow
13.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>)
/subsystem=opentelemetry:write-attribute(name=exporter-type, value=<exporter_type>)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
/subsystem=opentelemetry:write-attribute(name=exporter-type, value=otlp)
/subsystem=opentelemetry:write-attribute(name=exporter-type, value=otlp)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the endpoint at which to export the traces.
Syntax
/subsystem=opentelemetry:write-attribute(name=endpoint, value=<URL:port>)
/subsystem=opentelemetry:write-attribute(name=endpoint, value=<URL:port>)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
/subsystem=opentelemetry:write-attribute(name=endpoint, value=http://localhost:4317)
/subsystem=opentelemetry:write-attribute(name=endpoint, value=http://localhost:4317)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the service name under which the traces are exported.
Syntax
/subsystem=opentelemetry:write-attribute(name=service-name, value=<service_name>)
/subsystem=opentelemetry:write-attribute(name=service-name, value=<service_name>)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example
/subsystem=opentelemetry:write-attribute(name=service-name, value=exampleOpenTelemetryService)
/subsystem=opentelemetry:write-attribute(name=service-name, value=exampleOpenTelemetryService)Copy to Clipboard Copied! Toggle word wrap Toggle overflow