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 2.7.1.3 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:

  1. Install ARMS for OpenTelemetry Collector by using the application catalog in the ACK console.
    1. Log on to the ACK console.
    2. In the left-side navigation pane, choose Marketplace > Marketplace.
    3. On the Marketplace page, enter ack-arms-cmonitor in the search box and then click ack-arms-cmonitor.
    4. On the ack-arms-cmonitor page, click Deploy in the upper-right corner.
    5. 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.
    6. Click OK.
    7. In the left-side navigation pane, click Clusters, and then click the name of the cluster where the ack-arms-cmonitor component was installed.
    8. In the left-side navigation pane, choose Workloads > DaemonSets. At the top of the page, set Namespace to arms-prom.
    9. 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. otel-collector-service
  2. Change the exporter endpoint in the SDK of your application to otel-collector-service:Port.
    Endpoint example

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>
Note
  • 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. Trace details
  • 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.

    Overall Analysis tab
  • 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
    Span details
    Figure 2. Trace analysis
    Specify analysis conditions
  • 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.

    Log Analysis