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:
| Directory | Purpose |
|---|---|
/plugins | Active plug-ins. Adding or removing a JAR here enables or disables that plug-in. |
/logs | Agent log files (default location). |
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
Log on to the Managed Service for OpenTelemetry console.
In the left-side navigation pane, click Integration Center.
In the Open Source Frameworks section, click the SkyWalking card.
In the SkyWalking panel, click the Start Integration tab and select a region.
NoteWhen you access a region for the first time, resources are automatically initialized.
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.

Old console
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 and copy the endpoint from the Related Information column.
NoteUse a VPC endpoint if your application runs in an Alibaba Cloud production environment. Otherwise, use a public endpoint.

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:
| Placeholder | Description |
|---|---|
<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.
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_OPTSWindows 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
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 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
Configuration methods
Override agent.config values with any of the following methods, listed from highest to lowest precedence:
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 -- Pass values with the
-Dskywalking.prefix:java -javaagent:/path/to/skywalking-agent.jar -Dskywalking.agent.service_name=<your-service-name> -jar your-project.jarEnvironment variables -- Export the corresponding environment variable defined in
agent.config. For example,agent.service_namemaps toSW_AGENT_NAME:export SW_AGENT_NAME=<your-service-name>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.

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.

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

If no data appears, check for these common causes:
Sampling is enabled -- If
agent.sample_n_per_3_secsis set to a low value, some traces may not be captured.Data is filtered -- The
agent.ignore_suffixsetting may be discarding matching segments.No requests received -- The application has not processed any incoming requests since the agent started.