This topic describes how to import trace data from Java applications to Application Real-Time Monitoring Service (ARMS) by using OpenTelemetry.
Use OpenTelemetry to import trace data from Java applications
You can use multiple methods to import trace data from Java applications to Application Real-Time Monitoring Service (ARMS) with OpenTelemetry. You can directly import trace data from OpenTelemetry or use OpenTelemetry Collector to forward trace data to ARMS.
Directly import trace data from OpenTelemetry
- Use 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.
- Use the ARMS agent for Java applications and the OpenTelemetry SDK for Java
The ARMS agent for Java applications V2.7.1.3 and later 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 Use OpenTelemetry SDK for Java to manually instrument an application.
- Use 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. For more information, see Use OpenTelemetry to submit the trace data of Java applications.
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:
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>
- Replace
<endpoint>
with the endpoint of the exporter. Example:http://tracing-analysis-dc-bj.aliyuncs.com:8090
. - Replace
<token>
with the token obtained in the ACK console. Example:b590lhguqs@3a7*********9b_b590lhguqs@53d*****8301
.
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.
Figure 1. Trace query Figure 2. Trace analysis - 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.