on
14 Mar 2025
04:10 PM
- edited on
31 Mar 2025
08:53 AM
by
Michal_Gebacki
OpenTelemetry configuration of the Quarkus native application can be done by setting values in the src/main/resources/application.properties
or via the environment variables.
In case of deploying OA in the classicFullstack mode, you can export traces directly to the OneAgent API endpoint. The configuration might look like in the following way:
quarkus.otel.exporter.otlp.traces.protocol=http/protobuf
QUARKUS_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:14499/otlp/v1/traces
QUARKUS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:14499/otlp/v1/traces
quarkus.otel.exporter.otlp.endpoint=http://localhost:14499/otlp
QUARKUS_OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:14499/otlp
NOTE: The EEC ingestion endpoint is only available with Full-Stack and Infrastructure Monitoring deployments. It is not available with containerized setups. Please use ActiveGate as the export endpoint for container applications.
This is a general case when traces and metrics are being exported to Dynatrace API, and the configuration might look the following way:
quarkus.otel.exporter.otlp.traces.protocol=http/protobuf
QUARKUS_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
quarkus.otel.exporter.otlp.endpoint=https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/otlp
QUARKUS_OTEL_EXPORTER_OTLP_ENDPOINT=https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/otlp
quarkus.otel.exporter.otlp.headers="Authorization: Api-Token dt....."
QUARKUS_OTEL_EXPORTER_OTLP_HEADERS="Authorization: Api-Token dt....."
For troubleshooting purposes to understand which data is being exported by OTel in your application, you could add a logging exporter.
NOTE: it is not recommended to be used in production.
In this case, would be required to add to your project the dependency opentelemetry-exporter-logging and then configure it accordingly:
logging
exporter in the application.properties
file:# setting logging exporter for traces
# the parameter accepts list of exporters separated by commas
quarkus.otel.traces.exporter=logging
# setting logging exporter for metrics
# the parameter accepts list of exporters separated by commas
quarkus.otel.metrics.exporter=logging
# overriding the default 1m interval to 10s
quarkus.otel.metric.export.interval=10000ms
logging
exporter via environment variables:QUARKUS_OTEL_TRACES_EXPORTER=logging
QUARKUS_OTEL_METRICS_EXPORTER=logging
QUARKUS_OTEL_METRIC_EXPORT_INTERVAL=10000ms
For reference, please have a look at the official Quarkus OpenTelemetry Configuration page.