Configuring Quarkus to export OpenTelemetry signals to Dynatrace

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.

Quarkus application is run on the host with OneAgent:

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:

  • set the supported protocol:
    app property: quarkus.otel.exporter.otlp.traces.protocol=http/protobuf
    env variable: QUARKUS_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
  • then use one of the following URLs. However, please note that OA on the host accepts only traces, and when specified, generic endpoint metrics and logs will be rejected:
    • set endpoint for traces only:
      app property: quarkus.otel.exporter.otlp.traces.endpoint=http://localhost:14499/otlp/v1/traces
      env variable: QUARKUS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://localhost:14499/otlp/v1/traces
    • generic endpoint for OTel signals as Quarkus, then substitute the exact URL for traces or metrics:
      app property: quarkus.otel.exporter.otlp.endpoint=http://localhost:14499/otlp
      env variable: 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.

Exporting traces to Dynatrace API:

This is a general case when traces and metrics are being exported to Dynatrace API, and the configuration might look the following way:

  • set the supported protocol:
    app property: quarkus.otel.exporter.otlp.traces.protocol=http/protobuf
    env variable: QUARKUS_OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobuf
  • generic endpoint for OTel signals as Quarkus, then substitute the exact URL for traces or metrics (all available endpoints are available here:
    app property: quarkus.otel.exporter.otlp.endpoint=https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/otlp
    env variable: QUARKUS_OTEL_EXPORTER_OTLP_ENDPOINT=https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/otlp
  • also, is required to set the authorization header:
    app property: quarkus.otel.exporter.otlp.headers="Authorization: Api-Token dt....."
    env variable: QUARKUS_OTEL_EXPORTER_OTLP_HEADERS="Authorization: Api-Token dt....."

Troubleshooting

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:

  • set the 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
    
  • set the 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.

3 Likes