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:
| Directory | Purpose |
|---|---|
config/ | Configuration files, including agent.config |
/plugins | Active plug-ins. Add or remove JAR files to enable or disable plug-ins. |
/logs | Agent log files |
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
Log on to the Managed Service for OpenTelemetry console.
In the left-side navigation pane, click Cluster Configurations, then click the Access point information tab.
In the top navigation bar, select a region. In the Cluster Information section, turn on Show Token.
Set Client to SkyWalking.
Copy the endpoint from the Related Information column.

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>| Placeholder | Description |
|---|---|
<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.jarReplace <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:
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_OPTSWindows 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
The -javaagent parameter must appear before -jar.
java -javaagent:<skywalking-agent-path> -jar yourApp.jarJetty
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:
| Priority | Method | Example |
|---|---|---|
| 1 (highest) | Agent options | -javaagent:/path/to/skywalking-agent.jar=agent.service_name=<your-service-name>,agent.authentication=<your-token> |
| 2 | System properties | -Dskywalking.agent.service_name=<your-service-name> |
| 3 | Environment variables | export SW_AGENT_NAME=<your-service-name> |
| 4 (lowest) | Configuration file | Edit 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.jarSystem 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.jarEnvironment 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
Plug-ins
The SkyWalking Java agent uses a plug-in system to support a wide range of middleware, frameworks, and libraries.
Plug-in types
| Type | Location | Activation |
|---|---|---|
| Official plug-ins | /plugins | Active by default. Remove a JAR to deactivate. |
| Optional plug-ins | /optional-plugins | Move the JAR to /plugins to activate. |
| Bootstrap plug-ins | /bootstrap-plugins | Move the JAR to /plugins to activate. Use with caution due to potential stability risks. |


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

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.