https://github.com/kindlingproject/kindling-java
https://github.com/kindlingproject/kindling-java
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/kindlingproject/kindling-java
- Owner: KindlingProject
- License: apache-2.0
- Created: 2022-10-14T06:49:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-10T09:20:08.000Z (about 3 years ago)
- Last Synced: 2025-04-15T01:13:43.634Z (about 1 year ago)
- Language: Java
- Size: 143 KB
- Stars: 6
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# kindling-java
Kindling-java is an attach agent to collect Java CPU / LOCK for probe which relies on [async-profiler](https://github.com/KindlingProject/async-profiler). Besides it also collect traceId / span Info generated by SkyWalking & Pinpoint agent.
Features
* [Event] Collect datas by events specified by event argument[cpu / lock / traceid].
* [Plugins] Enhance SkyWalking Agent and print traceId and span into /dev/null.
* [Plugins] Enhance Pinpoint Agent and print traceId and span into /dev/null.
## Build Kindling Java
```
# Binary will be built in agent-package/target/kindling-java-${version}.tar.gz
$ mvn clean package -Dmaven.test.skip=true
kindling-java
├── 1.0.3
│ ├── agent-core.jar
│ ├── plugin-span-pp.jar
│ ├── plugin-span-sw.jar
│ ├── plugin-traceid-pp.jar
│ └── plugin-traceid-sw.jar
├── agent-boot.jar
└── version
```
## Build AsyncProfiler
```
git clone -b kindling git@github.com:KindlingProject/async-profiler.git
cd async-profiler
./build.sh
# Copy Kindling Java into async-profiler/agent folder
tar -zxvf async-profiler-${version}-linux-x64.tar.gz
mkdir -p async-profiler/agent
tar -zxvf
mv kindling-java -zxvf $KINDLING_JAVA_FOLDER/agent-package/target/kindling-java-${version}.tar.gz -C async-profiler/agent/
cd async-profiler
```
We also support build in container using following command.
```
$ ./build.sh linux-${arch}
X64: ./build.sh linux-x64
X64-MUSL ./build.sh linux-x64-musl
ARM64 ./build.sh linux-arm64
## Attach Java Application
> ./profiler.sh start $options $pid
Options:
* -e EvnetTypes cpu / lock / traceid, all is opened by default.
* -i Collect CPU interval(nanosecond), default is 10000000.
* -j Collect CPU stack max-depth, default is 20.
Eg.
```
# Collect CPU with max-depth 10.
> ./profiler.sh start -e cpu -j 10 $pid
# Open CPU & LOCK
> ./profiler.sh start -e cpu -e lock $pid
```
## Detach Java Application
> ./profiler.sh stop $pid
## How it works
* Jcopy copy the agent and libasyncprofiler.so into container.
* Jattach attach agent into application.
* Agent start asyncProfiler by call asyncProfielr API.
* Load libasyncprofiler.so
* Execute start/stop command
* Execute print to collect CPU data at fixed rate
* Agent enhance Skywalking / Pinpoint agent by asm and print traceid into /dev/null.
* Begin / End life cycle of the trace
* When trace is dispatched into another thread, begin / end life cycle of the runnable execution.