OpenTelemetry
OpenTelemetry is an open source, vendor neutral standard for distributed systems that are used to track the current state of the job. OpenTelemetry is a set of APIs, SDKs, tooling, and integrations designed to create and manage telemetry data such as traces and metrics.
For more information about OpenTelemetry, see OpenTelemetry documentation.
Enabling or Disabling OpenTelemetry
OpenTelemetry can be enabled or disabled through the Monitoring UI and the BW_JAVA_OPTS environment variable.
Monitoring UI
Enable or disable OpenTelemetry.
BW_JAVA_OPTS
Environment Variable
Configure the following engine property in the BW_JAVA_OPTS environment variable while running the application to enable and disable OpenTelemetry:
- bw.engine.opentelemetry.enable=true.
Note: By default, the property is false.
The following table describes how you can enable trace, metric, or both the variants simultaneously by setting up the BWEngine properties accordingly:
Properties | Trace | Metric |
---|---|---|
bw.engine.opentelemetry.enable=true
| Enable | Disable |
bw.engine.opentelemetry.enable=true
| Disable | Enable |
bw.engine.opentelemetry.enable=true
| Enable | Enable |
OpenTelemetry via OpenTelemetry-Collector
- Set up the OpenTelemetry-collector service. You can further integrate OpenTelemetry with a tracing service provider that is compliant with OpenTelemetry.
To configure OpenTelemetry native properties for traces, set the bw.opentelemetry.autoConfigured
system property to True
. Once this property is set to true, you can use the environment variables https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/ listed out here.
To send data over the HTTP protocol for OpenTelemetry traces and metrics, set the bw.engine.opentelemetry.http.protocol
system property to True
.
To configure AWS_XRAY for OpenTelemetry traces and metrics, set the bw.engine.opentelemetry.enable
, bw.opentelemetry.aws.xrayIdGenerator
, and bw.engine.opentelemetry.metric.enable
system property to True
.
To enable logging for the OpenTelemetry traces and metrics, set the io.opentelemetry
logger in the logback.xml
file. Pass this logger as an environment variable. On enabling this logger, all the detailed information about traces and metrics is available in the logs.
Logback file example:
<logger name="io.opentelemetry"><level value="ALL"/>
</logger>
Container (environment variable) example:
BW_LOGGER_OVERRIDES="io.opentelemetry=ALL"
The OpenTelemetry TraceId and SpanId parameters can be mapped from an application's ProcessContext to any output activity such as Log or Write File.