- JDK 11 (As of now this application works on Java 11.)
- Gradle 7+(Tested in 7.4.1)
- Docker(with docker-compose)
./docker-compose docker-compose -f skywalking.yml up
gradle :zull-gateway:bootRun
gradle :user-service:bootRun
import skywalking-poc.postman_collection.json
into postman
Hit these curl calls multiple times:
curl --location 'http://localhost:9080/demo/api/user'
--header 'token: test'
--header 'Content-Type: application/json'
--data '{
"name": "test320"
}'
curl --location 'http://localhost:9080/demo/api/user'
--header 'token: test'
- 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:9.1.0' ``` * Code: `@Trace`, `@TraceCrossThread`, `ActiveSpan`, `TraceContext`
- Add logback trace id
- gradle
implementation 'org.apache.skywalking:apm-toolkit-logback-1.x:9.1.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}"/>
For gradle as an example
bootRun {
jvmArgs = ["-Dskywalking.agent.service_name=zull-gateway", "-javaagent:$projectDir/skywalking-agent/skywalking-agent.jar"]
}
skywalking.agent.service_name
should be same as service name inapplication.yml
to avoid some issues.