All Products
Search
Document Center

Application Real-Time Monitoring Service:Get started with Managed Service for OpenTelemetry

Last Updated:Jan 19, 2024

This topic describes how to grant Managed Service for OpenTelemetry the permissions to read data from and write data to Simple Log Service and how to report application data to Managed Service for OpenTelemetry. This helps you get started with Managed Service for OpenTelemetry. In the example demonstrated in this topic, a Java application is used.

Prerequisites

  • An Alibaba Cloud account is created.

  • Managed Service for OpenTelemetry is activated.

  • Simple Log Service is activated.

  • Resource Access Management (RAM) is activated.

Grant Managed Service for OpenTelemetry the permissions to read data from and write data to Log Service

  1. Log on to the Managed Service for OpenTelemetry console.

  2. On the page that appears, click Authorize to grant Managed Service for OpenTelemetry the permissions to read data from and write data to Log Service.

  3. In the message that appears, click OK.

Use the OpenTelemetry Java agent to perform automatic instrumentation on an application

In the following example, the OpenTelemetry Java agent is used to report the data of a Java application. The OpenTelemetry Java agent allows you to connect OpenTelemetry to Managed Service for OpenTelemetry in a non-intrusive manner and can be used to automatically upload trace data in hundreds of Java frameworks. For more information about the supported frameworks, see Supported libraries, frameworks, application servers, and JVMs. For more information about how to use OpenTelemetry SDK for Java to manually instrument an application and report data, how to use other clients to report data, and how to report the data of applications that are developed in other languages, see the references at the end of this topic.

  1. Download the OpenTelemetry Java agent demo.

  2. Download the OpenTelemetry Java agent.

    In the latest version of Assets, find the opentelemetry-javaagent.jar package and download the package.

  3. Obtain the endpoint of the OpenTelemetry Java agent in the Managed Service for OpenTelemetry console.

    1. Log on to the Managed Service for OpenTelemetry console.

    2. In the left-side navigation pane, click Cluster Configurations. Then, click the Access point information tab.

    3. In the top navigation bar, select a region. In the Cluster Information section, turn on Show Token.

    4. In the Client section, click OpenTelemetry.

      Obtain an endpoint of OpenTelemetry in the Related Information column of the table in the lower part. OT接入点信息

      Note

      If your application is deployed in an Alibaba Cloud production environment, use a Virtual Private Cloud (VPC) endpoint. Otherwise, use a public endpoint.

  4. Modify the JVM parameters in the Java startup configuration to report trace data.

    -javaagent:/path/to/opentelemetry-javaagent.jar    // Replace the path with the URL that you use to download the OpenTelemetry Java agent. 
    -Dotel.resource.attributes=service.name=<appName>     // Replace <appName> with your application name. 
    -Dotel.exporter.otlp.headers=Authentication=<token>
    -Dotel.exporter.otlp.endpoint=<endpoint>

    Example:

    -javaagent:/Users/carpela/Downloads/opentelemetry-javaagent.jar
    -Dotel.resource.attributes=service.name=ot-java-agent-sample
    -Dotel.exporter.otlp.headers=Authentication=b590xxxxuqs@3a75d95xxxxx9b_b59xxxxguqs@53dxxxx2afe8301
    -Dotel.exporter.otlp.endpoint=http://tracing-analysis-dc-bj:8090

View the monitoring data

Log on to the ARMS console. In the left-side navigation pane, choose Application Monitoring > Applications. On the Applications page, click the name of the application. On the page that appears, view the trace data.

Note

If the Java图标 icon is displayed in the Language column, the application is connected to Application Monitoring. If a hyphen (-) is displayed, the application is connected to Managed Service for OpenTelemetry.

What to do next

After the application data is reported to the Managed Service for OpenTelemetry console, you can perform the following operations in the Managed Service for OpenTelemetry console:

You can report the data of Java, Go, Python, JavaScript, .NET, and C++ applications to the Managed Service for OpenTelemetry console. The clients that you can use to report data include OpenTelemetry, Jaeger, Zipkin, and SkyWalking.

Programming language

Reference

Java

PHP

Use OpenTelemetry to report PHP application data

Go

Python

Node.js

.NET

C++

Ruby

Use OpenTelemetry to submit the trace data of Ruby applications

Swift

Use OpenTelemetry to submit the trace data of Swift applications

Android

Use OpenTelemetry to report the trace data of Android applications

Rust

Use SkyWalking to submit the trace data of Rust applications