This is a demo project for Skywalking Java agent, which shows how to use Skywalking Java agent in a Java application.
Download Skywalking Java agent from Skywalking official website, and unzip it.
wget https://dlcdn.apache.org/skywalking/java-agent/8.16.0/apache-skywalking-java-agent-8.16.0.tgz \
&& mkdir agent \
&& tar -zxvf apache-skywalking-java-agent-8.16.0.tgz -C ./agent --strip-components 1
Update agent.config
file in ./agent/config
directory, and set collector.backend_service
to your Skywalking OAP
server address.
# Set service name
agent.service_name=${SW_AGENT_NAME:java-app}
# Set Skywalking OAP server address
collector.backend_service=${SW_AGENT_COLLECTOR_BACKEND_SERVICES:127.0.0.1:11800}
Add -javaagent
option to your Java application.
mvn clean package
java \
-javaagent:./agent/skywalking-agent.jar \
-jar target/swapp-0.0.1-SNAPSHOT.jar