All Products
Search
Document Center

Application Real-Time Monitoring Service:Use SkyWalking to report Java application data

Last Updated:Mar 10, 2026

Apache SkyWalking is an open-source Application Performance Monitoring (APM) and distributed tracing system built for microservices and cloud-native architectures, including Docker, Kubernetes, and Mesos. The SkyWalking Java agent provides automatic instrumentation for frameworks such as Dubbo, gRPC, JDBC, OkHttp, Spring, Tomcat, Struts, and Jedis.

After you attach the SkyWalking Java agent to your application, trace data is reported to the Managed Service for OpenTelemetry console. You can then view application topology, traces, abnormal and slow transactions, and SQL analysis.

SkyWalking also supports manual instrumentation based on the OpenTracing standard. This topic covers automatic instrumentation setup and agent configuration.

For a working example, see the skywalking-demo repository on GitHub.

Automatically instrument a Java application

The following steps walk you through downloading the SkyWalking agent, configuring the endpoint and authentication, setting the application name, and attaching the agent to your Java process.

Step 1: Download and extract the SkyWalking agent

Download SkyWalking 6.x.x or later (latest stable version recommended) and extract the archive. Store the agent folder in a location accessible to your Java processes.

The agent folder contains the following directories:

DirectoryPurpose
config/Configuration files, including agent.config
/pluginsActive plug-ins. Add or remove JAR files to enable or disable plug-ins.
/logsAgent log files
Warning

Do not modify the agent folder structure. All logs, plug-ins, and configuration files must remain in their default locations.

Step 2: Get the SkyWalking endpoint and token

  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.

  5. Copy the endpoint from the Related Information column.

SkyWalking endpoint information
Note

Use a VPC endpoint if your application runs in an Alibaba Cloud production environment. Use a public endpoint for all other environments.

Step 3: Configure the endpoint and token

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

collector.backend_service=<endpoint>
agent.authentication=<auth-token>
PlaceholderDescription
<endpoint>SkyWalking endpoint for your region. Obtain the endpoint from the Related Information column on the Access point information tab.
<auth-token>Authentication token from the console. Turn on Show Token in the Cluster Information section to view it.

Step 4: Set the application name

Choose one of the following methods. If you use both, the startup command parameter takes precedence.

Method 1: Configuration file

In config/agent.config, set the service name:

agent.service_name=<ServiceName>

Method 2: Startup command parameter

Add -Dskywalking.agent.service_name to the JVM startup command:

java -javaagent:<skywalking-agent-path> -Dskywalking.agent.service_name=<ServiceName> -jar yourApp.jar

Replace <ServiceName> with your application name.

Step 5: Attach the agent to your application

Add the -javaagent parameter pointing to the skywalking-agent.jar file in the agent folder. Replace <skywalking-agent-path> with the absolute path to this file.

Choose the method that matches your deployment:

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 at 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 at 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 6: Restart the application

Restart the application. Trace data is reported to Managed Service for OpenTelemetry automatically once the application starts handling requests.

Agent configuration reference

The SkyWalking Java agent is configured through config/agent.config. The following table lists commonly used attributes for V8.16.0.

Configuration methods

Agent attributes support four configuration methods, listed from highest to lowest priority:

PriorityMethodExample
1 (highest)Agent options-javaagent:/path/to/skywalking-agent.jar=agent.service_name=<your-service-name>,agent.authentication=<your-token>
2System properties-Dskywalking.agent.service_name=<your-service-name>
3Environment variablesexport SW_AGENT_NAME=<your-service-name>
4 (lowest)Configuration fileEdit config/agent.config directly

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

System properties

Use the -Dskywalking. prefix followed by the attribute key:

java -javaagent:/path/to/skywalking-agent.jar -Dskywalking.agent.service_name=<your-service-name> -jar your-project.jar

Environment variables

Mappings are defined in config/agent.config. For example, agent.service_name maps to SW_AGENT_NAME:

# In agent.config
agent.service_name=${SW_AGENT_NAME:default_name}

# Set the environment variable
export SW_AGENT_NAME=<your-service-name>

Agent attributes

View agent attributes

AttributeDescriptionDefault value
agent.namespaceNamespace to isolate headers in cross-process propagation. When set, the header name becomes HeaderName:Namespace.Not set
agent.service_nameService name displayed in the SkyWalking UI. Use a unique name for each service. Multiple instances of the same service share this name.Your_ApplicationName
agent.sample_n_per_3_secsNumber of trace samples collected every 3 seconds. A negative number or 0 disables sampling.Not set
agent.authenticationAuthentication token for the backend endpoint.Not set
agent.span_limit_per_segmentMaximum number of spans per segment. Helps control memory usage.Not set
agent.ignore_suffixIf the first span's operation name matches a value in this list, the segment is ignored.Not set
agent.is_open_debugging_classWhen true, stores all instrumented class files in the /debugging folder for troubleshooting.Not set
agent.cause_exception_depthStack depth recorded when logging exceptions.5
agent.force_reconnection_periodForce reconnection period, in multiples of grpc_channel_check_interval.1
agent.operation_name_thresholdMaximum operation name length. Absolute maximum is 190 characters.150
agent.keep_tracingWhen true, continues tracing even when the backend is unavailable.false
osinfo.ipv4_list_sizeMaximum number of IPv4 addresses to report.10
collector.grpc_channel_check_intervalInterval (seconds) to check gRPC channel status.30
collector.backend_serviceAddress of the SkyWalking collector backend.127.0.0.1:11800
collector.heartbeat_periodHeartbeat report interval (seconds).30
collector.grpc_upstream_timeoutgRPC upstream send timeout (seconds).30
collector.get_profile_task_intervalInterval (seconds) to query profiling tasks.20
logging.levelLog level.DEBUG
logging.file_nameLog file name.skywalking-api.log
logging.outputLog output mode: FILE or CONSOLE.FILE
logging.dirLog directory. Empty string means the default system.out 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 one is created.314572800 (300 MB)
logging.max_history_filesMaximum number of archived log files. A negative number or 0 means no limit.-1

Plug-ins

The SkyWalking Java agent uses a plug-in system to support a wide range of middleware, frameworks, and libraries.

Plug-in types

TypeLocationActivation
Official plug-ins/pluginsActive by default. Remove a JAR to deactivate.
Optional plug-ins/optional-pluginsMove the JAR to /plugins to activate.
Bootstrap plug-ins/bootstrap-pluginsMove the JAR to /plugins to activate. Use with caution due to potential stability risks.
Optional plug-ins folderBootstrap plug-ins folder

Supported plug-ins

Official plug-ins are maintained in the /plugins folder. Additional plug-ins that may affect performance are available in a third-party repository.

View supported plug-ins

CategoryFramework
HTTP serverTomcat 7, Tomcat 8, Tomcat 9, Spring Boot Web 4.x, Spring MVC 3.x/4.x/5.x with servlet 3.x, Nutz Web Framework 1.x, Struts2 MVC 2.3.x to 2.5.x, Resin 3, Resin 4, Jetty Server 9, Spring Webflux 5.x, Undertow 2.0.0.Final to 2.0.13.Final, RESTEasy 3.1.0.Final to 3.7.0.Final, Play Framework 2.6.x to 2.8.x, Light4J Microservices Framework 1.6.x to 2.x, Netty SocketIO 1.x
HTTP clientFeign 9.x, Netflix Spring Cloud Feign 1.1.x/1.2.x/1.3.x, OkHttp 3.x, Apache HttpClient 4.2 and 4.3, Spring RestTemplate 4.x, Jetty Client 9, Apache AsyncClient 4.x
HTTP gatewaySpring Cloud Gateway 2.1.x.RELEASE
JDBCMySQL Driver 5.x/6.x/8.x, Oracle Driver, H2 Driver 1.3.x to 1.4.x, Sharding-JDBC 1.5.x, ShardingSphere 3.0.0, 4.0.0-RC1, PostgreSQL Driver 8.x/9.x/42.x, MariaDB Driver 2.x and 1.8
RPCDubbo 2.5.4 to 2.6.0, Dubbox 2.8.4, Apache Dubbo 2.7.0, Motan 0.2.x to 1.1.0, gRPC 1.x, Apache ServiceComb Java Chassis 0.1 to 0.5 and 1.0.x, SOFARPC 5.4.0, Armeria 0.63.0 to 0.98.0, Apache Avro 1.7.0 to 1.8.x, Finagle 6.25.0 to 20.1.0
MQRocketMQ 4.x, Kafka 0.11.0.0 to 1.0, ActiveMQ 5.x, RabbitMQ 5.x, Pulsar 2.2.x to 2.4.x
NoSQLJedis 2.x, Redisson 3.5.2+, Lettuce 5.x, MongoDB Java Driver 2.13/2.14/3.3+, Spymemcached 2.x, Xmemcached 2.x, Elasticsearch transport-client 5.2.x to 5.6.x, Elasticsearch transport-client 6.7.1 to 6.8.4, Elasticsearch rest-high-level-client 6.7.1 to 6.8.4, SolrJ 7.x, Cassandra java-driver 3.7.0 to 3.7.2
Service discoveryNetflix Eureka
Distributed coordinationZooKeeper 3.4.x (except 3.4.4)
Spring ecosystemSpring Bean annotations (@Bean, @Service, @Component, @Repository) 3.x and 4.x, Spring Core Async SuccessCallback/FailureCallback/ListenableFutureCallback 4.x, Hystrix 1.4.20 to 1.5.12
SchedulerElastic Job 2.x
OthersOpenTracing community support, Canal 1.0.25 to 1.1.2, GSON 2.8.x, Vert.x Eventbus 3.2+, Vert.x Web 3.x, Spring @Async 4.x and 5.x, Ehcache 2.x, Kotlin Coroutine 1.0.1 to 1.3.x

Develop a custom plug-in

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

FAQ

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

A: Trace data may not be reaching Managed Service for OpenTelemetry. Check the agent log at {skywalking-agent-path}/logs/skywalking-api.log for reporting activity. A successful report looks like this:

SkyWalking API log showing successful data reporting

Common causes for missing data:

  • Sampling is enabled and filtering out traces.

  • Data is being filtered by agent configuration.

  • No requests have been made to the application to trigger trace collection.

References