Menu
Grafana Cloud

Migrate to the upstream OpenTelemetry Java SDK

The Grafana OpenTelemetry Java distribution is fully compatible with the upstream OpenTelemetry auto-instrumentation SDK. Follow these steps to migrate to the upstream SDK:

  1. Remove the grafana prefix from all configuration environment variables or system properties.

  2. To replicate the data saver features, use the OpenTelemetry Collector to filter metrics.

  3. The OpenTelemetry Java SDK does not bundle the resource detectors for Kubernetes, use the OpenTelemetry Collector to add Kubernetes resource attributes.

  4. Add the following environment variables required by Application Observability:

    shell
    export OTEL_INSTRUMENTATION_MICROMETER_BASE_TIME_UNIT=s
    export OTEL_INSTRUMENTATION_LOG4J_APPENDER_EXPERIMENTAL_LOG_ATTRIBUTES=true
    export OTEL_INSTRUMENTATION_LOGBACK_APPENDER_EXPERIMENTAL_LOG_ATTRIBUTES=true