Contact Us

Autoinstrumentation for Java


Please verify if you are using the SAP Java Buildpack.

  1. Open your mta.yaml file
  2. Search for the term "buildpack"
  3. You are using the SAP Java Buildback if:
    1. There is no entry for the parameter "buildpack"
    2. The value for the parameter buildpack is "sap_java_buildback"

You can find information on how to use the SAP Java Buildpack here.

If you are using SAP Java Build Pack you do not need to perform the steps in section "Maven Setup".

SAP Java Build Pack Setup

If you are using the SAP Java Build pack:

  • create a new user-provided service in the application's space named xotel-agent-ext-java with the following content:

    "account": "<name of subaccount in which the instrumented application is running>"

  • create a binding to this service in the application

Maven Setup

If you are not using the SAP Java Buildpack include the dependency in your pom.xml:







Add the following Java VM parameters via the mta.yaml:



  - name: <MyService>

    type: java




      JBP_CONFIG_OPEN_JDK_JRE: "{ jre: { version: 11.+ }}"

      JBP_CONFIG_JAVA_OPTS: "[java_opts: '-javaagent:BOOT-INF/lib/opentelemetry-javaagent-1.29.0.jar -Dotel.javaagent.extensions=BOOT-INF/lib/otel-agent-ext-java-1.5.4.jar -Dotel.javaagent.enabled=true<MyService> -Dotel.traces.exporter=none -Dotel.metrics.exporter=none -Dotel.propagators=sapuniversal -Dotel.resource.attributes=account=<subaccount name>,calmTenantId=<subaccount id>,otel.poll.service.type=SAP_CP_CF,otel.poll.every.second=60']"

Make sure to replace the following parameters in the parameter JBP_CONFIG_JAVA_OPTS:

  • <MyService>: Name of the CF service
  • <subaccount name>: Name of the subaccount, where the instrumented application is running.
  • <subaccount id>: Technical ID of the subaccount, where the instrumented application is running. The technical ID can be found in the SAP BTP cockpit and has the form of a guid: 12345678-1234-1234-1234-123456789abc and will be used by SAP Cloud ALM to map the data to the corresponding cloud service.