This topic describes how to import trace data from Java applications to Application Real-Time Monitoring Service (ARMS) through OpenTelemetry.
Import trace data from Java applications to ARMS through OpenTelemetry
ARMS supports multiple methods to import trace data from Java applications through OpenTelemetry. You can directly import trace data from Java applications to ARMS through OpenTelemetry or forward trace data to ARMS through OpenTelemetry Collector.
Directly import trace data from Java applications to ARMS through OpenTelemetry
- Import trace data by using the ARMS agent for Java applications
To import trace data from Java applications to ARMS, we recommend that you install the ARMS agent for Java applications. The ARMS agent for Java applications is an out-of-the-box solution for automatically reporting trace data. The agent contains a large number of instrumentation libraries for common components. For more information, see Monitor Java applications.
- Import trace data by using the ARMS agent for Java applications and the OpenTelemetry
SDK for Java
The ARMS agent for Java applications 188.8.131.52 or later versions support OpenTelemetry SDK for Java extensions. You can use the ARMS agent for Java applications to automatically obtain the trace data of common components and use the OpenTelemetry SDK for Java to instrument custom methods. For more information, see OpenTelemetry SDK for Java.
- Import trace data by using the OpenTelemetry SDK for Java and a Jaeger exporter
You can use the OpenTelemetry SDK for Java to instrument your application and then use a Jaeger exporter to report trace data.
Forward trace data to ARMS by using OpenTelemetry Collector
Forward trace data to ARMS by using ARMS for OpenTelemetry Collector
You can install ARMS for OpenTelemetry Collector in a Container Service for Kubernetes (ACK) cluster and use the collector to forward trace data. ARMS for OpenTelemetry Collector provides a variety of easy-to-use and reliable functions, including lossless statistics, dynamic parameter tuning, application state management, and out-of-the-box tracing dashboards on Grafana. The lossless statistics function helps you pre-aggregate metrics on your machine, which negates the effect of sampling rate during statistics collection.
The following section describes the procedure of installing ARMS for OpenTelemetry Collector:
- Install ARMS for OpenTelemetry Collector by using the application catalog in the ACK
- Log on to the ACK console.
- In the left-side navigation pane, choose .
- On the Marketplace page, enter ack-arms-cmonitor in the search box and then click ack-arms-cmonitor.
- On the ack-arms-cmonitor page, click Deploy in the upper-right corner.
- In the Deploy panel, select the cluster where you want to install the ack-arms-cmonitor component
and click Next. Note The default namespace is arms-prom.
- Click OK.
- In the left-side navigation pane, click Clusters, and then click the name of the cluster where the ack-arms-cmonitor component was installed.
- In the left-side navigation pane, choose arms-prom. . At the top of the page, set Namespace to
- Click otel-collector-service to check whether the otel-collector-service is running as expected. If multiple receiver ports are exposed to receive OpenTelemetry data, it indicates the ack-arms-cmonitor component was installed successfully. The following figure shows an otel-collector-service that is running as expected.
- Change the exporter endpoint in the SDK of your application to
Forward trace data by using the open source OpenTelemetry Collector
To use the open source OpenTelemetry Collector to forward trace data to ARMS, you only need to modify the endpoint and token of the exporter.
exporters: otlp: endpoint: <endpoint>:8090 tls: insecure: true headers: Authentication: <token>
<endpoint>with the endpoint of the exporter. Example:
<token>with the token obtained in the ACK console. Example:
Use trace data
ARMS provides a variety of diagnostic features, such as trace details query, pre-aggregated metric dashboards, post-aggregated metric analysis of Trace Explorer, and access to the logs of trace-associated services, which ensures that trace data is used effectively.
- Trace details
You can view the interface call order and duration of the trace on the left side of the trace details page and view additional information and associated metrics, such as SQL, JVM, and host metrics, on the right side of the trace details page.
- Pre-aggregated metric dashboards
ARMS provides multiple pre-aggregated metric dashboards based on trace data. The dashboards include an application overview dashboard, API call dashboard, and database query dashboard. For more information, see View the key performance metrics and topology of an application.
- Post-aggregated metric analysis of Trace Explorer
ARMS provides multi-dimensional filtering and post-aggregated metric analysis features, such as querying the abnormal traces of applications. These features are helpful for debugging applications. ARMS also helps you aggregate trace data by IP address or API. For more information, see Trace Explorer.
- Access to the logs of trace-associated services
ARMS associates traces with service logs to help you troubleshoot exceptions by calling APIs. For more information, see Identify business exceptions by analyzing traces and logs.