Master SkyWalking: End‑to‑End Guide to Distributed Tracing, Setup & Monitoring
This tutorial walks through SkyWalking, an open‑source APM framework, explaining its features, architecture, how to install and configure the server and agents, persist data with MySQL, enable log collection, perform performance profiling, and set up alerting rules for robust distributed tracing.
What is SkyWalking?
SkyWalking is a Chinese open‑source APM framework launched in 2015 by Wu Sheng and entered the Apache incubator in 2017. It supports Dubbo, Spring Cloud, Spring Boot, provides non‑intrusive bytecode‑enhancement agents, GRPC communication, JVM monitoring, alarm, and global call statistics.
How to choose between SkyWalking and Spring Cloud Sleuth + Zipkin?
SkyWalking offers bytecode‑enhancement for zero‑intrusion and richer UI and reporting features compared with the more invasive Zipkin approach.
SkyWalking architecture
It consists of four main components: Agent (collects trace data), OAP server (analysis, storage, query), UI (web console), and Storage (supports multiple back‑ends).
Server setup
Download the desired version (e.g., 8.7.0) from the official site, unzip and note the directory layout:
agent – client‑side agent jar
bin – startup scripts
config – configuration files
logs – OAP logs
oap‑libs – OAP dependencies
webapp – UI files
Configuration changes
Modify
/config/application.ymlto use Nacos as the registry and adjust Nacos settings. Change
webapp/webapp.ymlto set the UI port (e.g., 8888).
Start services
Run
oapService.bat(or
.sh) and
webappService.bat, or use the provided
startup.batto launch both.
Client setup
Add the SkyWalking agent to each microservice via JVM arguments:
-javaagent:E:\springcloud\apache-skywalking-apm-es7-8.7.0\apache-skywalking-apm-bin-es7\agent\skywalking-agent.jar
-Dskywalking.agent.service_name=skywalking-product-service
-Dskywalking.collector.backend_service=127.0.0.1:11800Ensure the agent JAR path contains no spaces or non‑ASCII characters.
Persisting data
By default SkyWalking stores data in memory; to use MySQL, change
config/application.ymlstorage type to MySQL and add the JDBC driver JAR to
oap‑libs. The tables are created automatically on startup.
Log monitoring
SkyWalking can collect logs from Logback (or Log4j). Add the
apm-toolkit-logback-1.xdependency and a
logback‑spring.xmlconfiguration file as shown in the official documentation.
Performance profiling
Create an endpoint (e.g.,
/order/list) that sleeps for two seconds, then use the “Performance Profiling” module to trace the slow call and view the stack information.
Alerting
SkyWalking provides default alarm rules (e.g., average response time > 1 s). Rules are defined in
config/alarm-settings.ymland can be extended with webhooks to send notifications via email, WeChat, or DingTalk.
Summary
This article introduced SkyWalking as a distributed tracing solution, covering server and client deployment, data persistence, log collection, performance analysis, and alert configuration.
Su San Talks Tech
Su San, former staff at several leading tech companies, is a top creator on Juejin and a premium creator on CSDN, and runs the free coding practice site www.susan.net.cn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.