-
技術的なサポート
SAP プロダクトサポートへの連絡
-
技術以外のサポート
製品以外のサポートのお問い合わせ、または SAP Support Portal サイトに関するフィードバックをする
Autoinstrumentation for Java
Setup
Please verify if you are using the SAP Java Buildpack.
- Open your mta.yaml file
- Search for the term "buildpack"
- You are using the SAP Java Buildback if:
- There is no entry for the parameter "buildpack"
- 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:
<dependencies>
...
<dependency>
<groupId>io.opentelemetry.javaagent</groupId>
<artifactId>opentelemetry-javaagent</artifactId>
<version>1.29.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sap.xdsr</groupId>
<artifactId>otel-agent-ext-java</artifactId>
<version>1.5.4</version>
<scope>runtime</scope>
</dependency>
...
</dependencies>
Add the following Java VM parameters via the mta.yaml:
modules:
- name: <MyService>
type: java
...
properties:
...
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 -Dotel.service.name=<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.