All Products
Search
Document Center

Managed Service for OpenTelemetry:Use SkyWalking to report Java application data

Last Updated:Mar 11, 2026

When you run Java microservices across distributed environments, identifying performance bottlenecks and tracing requests across services requires instrumentation. The SkyWalking Java agent attaches to your application at startup and reports trace data to Managed Service for OpenTelemetry -- without code changes. After data starts flowing, you can view application topology, traces, abnormal and slow transactions, and SQL analysis in the console.

The following sections walk through attaching the SkyWalking Java agent to a Java application, configuring reporting, and managing plug-ins.

Prerequisites

  • SkyWalking 6.x or later downloaded and extracted. Use the latest stable version.

  • The extracted agent folder accessible by the Java process that runs your application

The agent folder contains the following key directories:

DirectoryPurpose
/pluginsActive plug-ins. Adding or removing a JAR here enables or disables that plug-in.
/logsAgent log files (default location).
Warning

Do not rename or relocate the agent folder. All logs, plug-ins, and configuration files must remain in this folder.

Instrument a Java application automatically

Step 1: Download the agent

Download SkyWalking Java Agent 8.16.0 and extract it.

Step 2: Get a reporting endpoint

Retrieve the endpoint and authentication token from the Managed Service for OpenTelemetry console. The console provides two interfaces:

New console

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

  2. In the left-side navigation pane, click Integration Center.

  3. In the Open Source Frameworks section, click the SkyWalking card.

  4. In the SkyWalking panel, click the Start Integration tab and select a region.

    Note

    When you access a region for the first time, resources are automatically initialized.

  5. Set the Connection Type and copy the endpoint.

    • Alibaba Cloud VPC Network -- Use this option if your service runs on Alibaba Cloud in the same region.

    • Public Network -- Use this option for all other scenarios.

    Endpoint configuration in the new console

Old 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. Set Client to SkyWalking and copy the endpoint from the Related Information column.

    Note

    Use a VPC endpoint if your application runs in an Alibaba Cloud production environment. Otherwise, use a public endpoint.

    Endpoint configuration in the old console

Step 3: Configure the agent

Open config/agent.config in the agent folder and set the following properties:

# Reporting endpoint from the Managed Service for OpenTelemetry console
collector.backend_service=<endpoint>

# Authentication token from the console
agent.authentication=<token>

# A unique name for your service
agent.service_name=<your-service-name>

Replace the placeholders with your actual values:

PlaceholderDescription
<endpoint>Reporting endpoint copied from the console
<token>Authentication token from the console
<your-service-name>A display name for your service in the SkyWalking UI

Step 4: Attach the agent to your application

Choose the attachment method for your runtime environment. In each example below, replace <skywalking-agent-path> with the absolute path to skywalking-agent.jar in the agent folder.

Important

Replace <skywalking-agent-path> in the following sample code with the absolute path to the skywalking-agent.jar file in the agent folder.

Linux Tomcat 7 / Tomcat 8

Add the following line to the beginning of tomcat/bin/catalina.sh:

CATALINA_OPTS="$CATALINA_OPTS -javaagent:<skywalking-agent-path>"; export CATALINA_OPTS

Windows Tomcat 7 / Tomcat 8

Add the following line to the beginning of tomcat/bin/catalina.bat:

set "CATALINA_OPTS=-javaagent:<skywalking-agent-path>"

JAR File or Spring Boot

Important

The -javaagent parameter must appear before -jar.

java -javaagent:<skywalking-agent-path> -jar yourApp.jar

Jetty

Add the following lines to {JETTY_HOME}/start.ini:

--exec
-javaagent:<skywalking-agent-path>

Step 5: Restart the application

Restart your application.

Sample code

For a complete working example, see the SkyWalking Demo repository.

Agent configuration reference

The config/agent.config file supports the following attributes (version 8.16.0):

Agent attributes

View agent attributes

AttributeDescriptionDefault
agent.namespaceNamespace for isolating headers in cross-process propagation. When set, headers use the format HeaderName:Namespace.Not set
agent.service_nameService name displayed in the SkyWalking UI. Set a unique name for each service. Multiple instances of a service share the same name.Your_ApplicationName
agent.sample_n_per_3_secsNumber of trace samples collected every 3 seconds. A negative value or 0 disables sampling.Not set
agent.authenticationAuthentication token for the backend.Not set
agent.span_limit_per_segmentMaximum number of spans per segment. Helps assess application memory usage.Not set
agent.ignore_suffixIf the first span's operation name matches an entry in this list, the segment is discarded.Not set
agent.is_open_debugging_classWhen true, saves all instrumented class files to /debugging. Useful for compatibility troubleshooting.Not set
agent.cause_exception_depthStack depth recorded for exceptions.5
agent.force_reconnection_periodForce reconnection period, based on grpc_channel_check_interval.1
agent.operation_name_thresholdMaximum operation name length (up to 190 characters).150
agent.keep_tracingWhen true, continues tracing even if the backend is unavailable.false
osinfo.ipv4_list_sizeMaximum number of IPv4 addresses to report.10
collector.backend_serviceBackend address that receives trace data.127.0.0.1:11800
collector.grpc_channel_check_intervalInterval (seconds) for checking gRPC channel status.30
collector.heartbeat_periodHeartbeat reporting interval (seconds).30
collector.grpc_upstream_timeoutTimeout (seconds) for sending data to the upstream gRPC service.30
collector.get_profile_task_intervalInterval (seconds) for querying profiling tasks.20
logging.levelLog level.DEBUG
logging.file_nameLog file name.skywalking-api.log
logging.outputLog output mode: FILE (default) or CONSOLE.FILE
logging.dirLog directory. Empty string means the default system output directory.""
logging.patternLog format. Supported specifiers: %level, %timestamp (yyyy-MM-dd HH:mm:ss:SSS), %thread, %msg, %class, %throwable, %agent_name.%level %timestamp %thread %class : %msg %throwable
logging.max_file_sizeMaximum log file size (bytes). When exceeded, the file is archived and a new file is created.314572800 (300 MB)
logging.max_history_filesMaximum number of archived log files. A negative value or 0 means no limit.-1

Configuration methods

Override agent.config values with any of the following methods, listed from highest to lowest precedence:

  1. Agent options -- Append key-value pairs after the agent JAR path in the JVM argument:

       # Syntax
       -javaagent:/path/to/skywalking-agent.jar=[key1]=[value1],[key2]=[value2]
    
       # Example
       java -javaagent:/path/to/skywalking-agent.jar=agent.service_name=<your-service-name>,agent.authentication=<your-token> -jar your-project.jar
  2. System properties -- Pass values with the -Dskywalking. prefix:

       java -javaagent:/path/to/skywalking-agent.jar -Dskywalking.agent.service_name=<your-service-name> -jar your-project.jar
  3. Environment variables -- Export the corresponding environment variable defined in agent.config. For example, agent.service_name maps to SW_AGENT_NAME:

       export SW_AGENT_NAME=<your-service-name>
  4. Configuration file -- Set values directly in config/agent.config (lowest precedence).

Plug-in management

SkyWalking provides automatic instrumentation for common frameworks including Dubbo, gRPC, JDBC, OkHttp, Spring, Tomcat, Struts, and Jedis. It also supports manual instrumentation based on the OpenTracing standard.

Official plug-ins

All JAR files in the /plugins directory are active by default. Remove a JAR to deactivate a plug-in; add a JAR to activate one.

Optional plug-ins

Additional plug-ins are available in the optional-plugins folder. To activate an optional plug-in, move its JAR file into the /plugins directory.

Optional plug-ins folder

Bootstrap plug-ins

Bootstrap plug-ins are stored in the bootstrap-plugins folder and are disabled by default due to potential stability risks. To use a bootstrap plug-in, copy its JAR file into the /plugins directory.

Bootstrap plug-ins folder

Third-party plug-ins

Some plug-ins are maintained outside the core SkyWalking repository due to performance considerations. For details, see java-plugin-extensions on GitHub.

View supported plug-ins

CategoryFrameworkVersion
HTTP serverTomcat7, 8, 9
Spring Boot Web4.x
Spring MVC with Servlet 3.x3.x, 4.x, 5.x
Nutz Web Framework1.x
Struts2 MVC2.3.x -- 2.5.x
Resin3, 4
Jetty Server9
Spring Webflux5.x
Undertow2.0.0.Final -- 2.0.13.Final
RESTEasy3.1.0.Final -- 3.7.0.Final
Play Framework2.6.x -- 2.8.x
Light4J Microservices Framework1.6.x -- 2.x
Netty SocketIO1.x
HTTP clientFeign9.x
Netflix Spring Cloud Feign1.1.x, 1.2.x, 1.3.x
OkHttp3.x
Apache HttpClient4.2, 4.3
Spring RestTemplate4.x
Jetty Client9
Apache AsyncClient4.x
HTTP gatewaySpring Cloud Gateway2.1.x.RELEASE
JDBCMySQL Driver5.x, 6.x, 8.x
Oracle Driver--
H2 Driver1.3.x -- 1.4.x
Sharding-JDBC1.5.x
ShardingSphere3.0.0, 4.0.0-RC1
PostgreSQL Driver8.x, 9.x, 42.x
MariaDB Driver1.8, 2.x
RPCDubbo2.5.4 -- 2.6.0
Dubbox2.8.4
Apache Dubbo2.7.0
Motan0.2.x -- 1.1.0
gRPC1.x
Apache ServiceComb Java Chassis0.1 -- 0.5, 1.0.x
SOFARPC5.4.0
Armeria0.63.0 -- 0.98.0
Apache Avro1.7.0 -- 1.8.x
Finagle6.25.0 -- 20.1.0
Message queueRocketMQ4.x
Kafka0.11.0.0 -- 1.0
ActiveMQ5.x
RabbitMQ5.x
Pulsar2.2.x -- 2.4.x
NoSQLJedis (Redis)2.x
Redisson (Redis)3.5.2+
Lettuce (Redis)5.x
MongoDB Java Driver2.13, 2.14, 3.3+
Spymemcached2.x
Xmemcached2.x
Elasticsearch transport-client5.2.x -- 5.6.x, 6.7.1 -- 6.8.4
Elasticsearch rest-high-level-client6.7.1 -- 6.8.4
SolrJ7.x
Cassandra Java Driver3.7.0 -- 3.7.2
Service discoveryNetflix Eureka--
CoordinationZooKeeper3.4.x (except 3.4.4)
Spring ecosystemSpring Bean annotations (@Bean, @Service, @Component, @Repository)3.x, 4.x
Spring Core Async (SuccessCallback, FailureCallback, ListenableFutureCallback)4.x
Hystrix1.4.20 -- 1.5.12
SchedulerElastic Job2.x
OpenTracingOpenTracing community support--
Data syncCanal (MySQL binlog-based incremental data sync)1.0.25 -- 1.1.2
JSONGSON2.8.x
Vert.xVert.x EventBus3.2+
Vert.x Web3.x
AsyncSpring @Async4.x, 5.x
CacheEhcache2.x
KotlinCoroutine1.0.1 -- 1.3.x

Develop a custom plug-in

To build a custom SkyWalking Java agent plug-in, see the SkyWalking plug-in development guide. Managed Service for OpenTelemetry supports trace reporting from custom plug-ins.

FAQ

Why does my application not appear in the console after connecting SkyWalking?

The agent may not be reporting data. Check {skywalking-agent-path}/logs/skywalking-api.log for reporting activity. Successful data reporting produces output similar to the following:

Successful reporting log output

If no data appears, check for these common causes:

  • Sampling is enabled -- If agent.sample_n_per_3_secs is set to a low value, some traces may not be captured.

  • Data is filtered -- The agent.ignore_suffix setting may be discarding matching segments.

  • No requests received -- The application has not processed any incoming requests since the agent started.

References