- JDK 1.8+
- Gradle 5+
- Docker(with docker-compose)
- http://skywalking.apache.org/downloads/
tar xzf apache-skywalking-apm-6.2.0.tar.gz mv -f apache-skywalking-apm-bin/agent ./agent rm -rf apache-skywalking-apm-bin
- Add manually trace in code
- gradle
implementation 'org.apache.skywalking:apm-toolkit-trace:6.2.0'
- Code:
@Trace
,@TraceCrossThread
,ActiveSpan
,TraceContext
- Add logback trace id
- gradle
implementation 'org.apache.skywalking:apm-toolkit-logback-1.x:6.2.0'
- logback.xml
<conversionRule conversionWord="tid" converterClass="org.apache.skywalking.apm.toolkit.log.logback.v1.x.LogbackPatternConverter"/> <property name="CONSOLE_LOG_PATTERN" value="%clr([%tid]%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
- [Not Recommend]Enable spring annotation trace plugin
mv agent/optional-plugins/apm-spring-annotation-plugin-6.2.0.jar agent/plugins/
For gradle as an example
bootRun {
jvmArgs = ["-Dskywalking.agent.service_name=gateway", "-javaagent:$projectDir/agent/skywalking-agent.jar"]
}
skywalking.agent.service_name
should be same as service name inapplication.yml
to avoid some issues.
gradle :gateway:bootRun
gradle :demo-service:bootRun
import Demo.postman_collection.json
into postman