Java applications have different integration Methods in different scenarios. This article describes detailed integration Actions for Java applications in various scenarios. After integration, you can automatically collect trace information, automatically generate metric, as well as perform trace search, log search, and other features.
Integration via OpenTelemetry (recommended)
OpenTelemetry is an observability project under CNCF, designed to provide standardized solutions in the observability field. It addresses the standardization of data models, collection, processing, and export of observability data, and offers services independent of third-party vendors.
If your application has already integrated the OpenTelemetry SDK, the APMPlus server side can receive data reported by OpenTelemetry. After integrating with APMPlus, you will gain capabilities such as RED metric generation, multidimensional trace search, single trace search, topology generation, and more.
- There are certain limits when converting OpenTelemetry Metrics to Prometheus Metrics:
- Data with aggregation method set to delta is not supported. Do not modify the default aggregation configuration on the SDK side. Ensure that the aggregation method on the SDK side is cumulative.
- Each workspace has its own data reporting credentials. To manage and isolate data using workspaces, ensure that the apmplus-opentelemetry-collector component has been upgraded to version v3.1.0 or above.
Method 1: Report directly to the ApmPlus server side
Observable data is reported directly to the ApmPlus server side, supporting data reporting via grpc, http/protobuf, and other Methods.
Method 2: Otel Collector forwarding
APMPlusOpenTelemetryCollector is a data collector developed by APMPlus based on OpenTelemetryCollector. You can install the Opentelemetry Collector in the cluster for data forwarding. There are two installation Methods:
- Install the apmplus-opentelemetry-collector component via the VKE cluster component center using the graphical installation interface. In addition, it is recommended to install the apmplus-server-agent component at the same time to enable metric data collection at the host and process levels.
- Manually install using the script provided on the service integration page.
Method 1: SDK integration
To report data using manual instrumentation with the community-provided Opentelemetry Java SDK, refer to the community's java demo. After building the Java project, specify the backend for data reporting and authentication parameters in the start command: - To report data directly to the ApmPlus server side:
- To report data to Collector, otel.exporter.otlp.headers does not need to be specified.
tip
<service_name> Enter the application service name.
Enter the server side address for your environment.
Enter the protocol used for data reporting. grpc and http/protobuf are supported.
Method 2: Probe integration
The Opentelemetry javaagent uses JVM bytecode enhancement technology to enable collection and automatic reporting of otel data for various popular Java frameworks. There are two specific usage methods: - Manual download of Javaagent
- The service access page provides the latest download method for Javaagent. Modify the start command when starting the application to inject the Javaagent:
- To report data directly to the ApmPlus server side:
- To report data to Collector, otel.exporter.otlp.headers does not need to be specified.
- Automatic injection via Opentelemetry Operator
- In k8s scenarios, Operator-based automatic injection of Javaagent into business POD containers is provided. You need to deploy the apmplus-opentelemetry-collector component in the cluster component center in advance.
- After deployment, modify the business workload (currently supports deployment and statefulset) to add the instrumentation.apmplus.volcengine.com/inject-java and instrumentation.apmplus.volcengine.com/workspace annotations.
- Method 1: Manual modification example:
Method 2: vke blank screen modification example, update the workload
After modification, restart the business POD.
Integration via Jaeger
Jaeger is an open-source distributed tracing system developed by Uber.
For existing systems already integrated with Jaeger, Jaeger trace data can be reported to APMPlus to achieve comprehensive trace monitoring capabilities.
After integrating with APMPlus, you will gain capabilities such as RED metric generation, multidimensional trace search, single trace search, topology generation, and more.
JaegerAgent integration
The SDK reports data to the Agent, and the Agent reports data to the APMPlus server side.
- Configure the application and enable data collection.
- Refer to the Jaeger documentation to send trace data to the Agent via UDP.
- Configure the Agent and modify the reporting endpoint.
- Modify the jaeger-agent start parameters. The configuration is as follows:
- Restart the application.
SDK direct reporting
The SDK performs data collection and reports directly to the APMPlus server side.
- Configure the application and turn on data collection.
- The following is sample code for configuring the reporter via the public network:
- Sample code for configuring the reporter via the private network is as follows:
- Restart the application.
Integration via Zipkin
Zipkin is an open-source distributed tracing system from Twitter. Zipkin helps you collect trace data.
For systems that have already integrated Zipkin, existing trace data can be reported to APMPlus to achieve comprehensive full-link monitoring capability.
After integrating with APMPlus, you will gain RED method generation, multidimensional trace search, single trace search, topology map generation, and many other APMPlus capabilities.
The SDK performs data collection and reports directly to the APMPlus server side.
- Configure the application and turn on data reporting.
- The following is an example for obtaining the zipkin reporting endpoint via the public network.
- The following is an example for obtaining the zipkin reporting endpoint via the private network.
- Integrate the service and configure the reporting endpoint. For specifics, see zipkin sample code.
- Restart the application.
Integration via SkyWalking
SkyWalking Agent performs data collection and reports directly to the APMPlus server side. Currently, integration of SkyWalking Trace, Meter, Log, JVM, and CLR data is supported.
- Configure the application and turn on data reporting.
- Configure the SkyWalking grpc reporting endpoint, set the authentication user identifier, and specify the service name. For specifics, see SkyWalking Documentation.
- Run the following command to start the service and SkyWalking Agent.
- Restart the application.
- After trace integration, you can view the topology map, Trace Analysis, service details, and other data.
- After meter integration, you can view data points among custom metrics.
- After log integration, you can view logs.
- After JVM and CLR integration, you can view metrics such as "skywalking_jvm_*" and "skywalking_clr_*" among custom metrics.