Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5,710 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkyWalking Coverage

This project extends Apache SkyWalking 8.0.1 with JaCoCo-based code coverage support, enabling runtime coverage collection and export functionality.
It is built and tested with JDK 8.

The core implementation is located in the following modules:

  • apm-agent-core
  • apm-agent

Build

git clone <this-repo>
cd skywalking
git submodule init
git submodule update
./mvnw clean package -DskipTests -Dcheckstyle.skip=true

Usage

To enable coverage collection, you must specify both scanPackage and openJacoco when starting the agent.

If these parameters are not provided, the agent behaves exactly like the original Apache SkyWalking agent.

Parameters

Parameter Description
scanPackage Package(s) to be instrumented for coverage. All classes under the specified package will be included.
openJacoco Enables or disables coverage collection (true or false).

Example

java -javaagent:/path/to/skywalking-agent.jar=agent.service_name=YourServiceName,scanPackage=com.your.package,openJacoco=true \
     -jar your-application.jar

How to View Coverage Data

The JaCoCo coverage file is written to the application working directory via a shutdown hook when the application terminates.
The generated file is named:

coverage.exec

⚠️ Currently, only shutdown-triggered export is supported.
Exporting coverage data via an HTTP endpoint can be easily added.


Generate Coverage Report

Use the JaCoCo CLI tool to generate reports from the .exec file:

java -jar jacococli.jar report coverage.exec \
  --classfiles target/classes \
  --sourcefiles src/main/java \
  --html report

After execution, open:

report/index.html

Architecture

This project integrates JaCoCo into the SkyWalking agent to collect runtime coverage data.

Key Components

  • JacocoInst: Initializes JaCoCo instrumentation at agent startup
  • JacocoCoverageTransformer: Enhances class bytecode for coverage tracking
  • JacocoCenter: Manages runtime coverage data
  • CoverageExportHook: Exports coverage data during JVM shutdown
  • CLI / Arguments Parser: Handles custom agent parameters

Workflow

  1. Agent starts with JaCoCo enabled
  2. Classes under scanPackage are instrumented
  3. Coverage data is collected during runtime
  4. On JVM shutdown, coverage data is dumped to coverage.exec

Limitations

  • Only shutdown-triggered coverage export is currently supported
  • No built-in HTTP export endpoint yet
  • Coverage is limited to specified scanPackage

Apache SkyWalking

Sky Walking logo

SkyWalking: an APM(application performance monitor) system, especially designed for microservices, cloud native and container-based (Docker, Kubernetes, Mesos) architectures.

GitHub stars Twitter Follow

Maven Central CI/IT Tests E2E Tests Code Coverage

Abstract

SkyWalking is an open source APM system, including monitoring, tracing, diagnosing capabilities for distributed system in Cloud Native architecture. The core features are following.

  • Service, service instance, endpoint metrics analysis
  • Root cause analysis. Profile the code on the runtime. Read Apache SkyWalking: Use Profiling to Fix the Blind Spot of Distributed Tracing.
  • Service topology map analysis
  • Service, service instance and endpoint dependency analysis
  • Slow services and endpoints detected
  • Performance optimization
  • Distributed tracing and context propagation
  • Database access metrics. Detect slow database access statements(including SQL statements).
  • Alarm

SkyWalking supports to collect telemetry (traces and metrics) data from multiple sources and multiple formats, including

  1. Java, .NET Core, NodeJS, PHP and Python auto-instrument agents.
  2. Go agent.
  3. LUA agent, especially for Nginx, OpenResty.
  4. Service Mesh Observability. Support Mixer telemetry. Recommend to use Envoy Access Log Service (ALS) for better performance, first introduced at KubeCon 2019.
  5. Metrics system, including Prometheus, Spring Sleuth(Micrometer).
  6. Zipkin v1/v2 and Jaeger gRPC format with limited topology and metrics analysis.(Experimental).

SkyWalking OAP is using the STAM(Streaming Topology Analysis Method) to analysis topology in the tracing based agent scenario for better performance. Read the paper of STAM for more details.

Document

8.x dev, 8.0 | 7.0 | 6.6, 6.5.

NOTICE, SkyWalking 8.0+ uses v3 protocols. They are incompatible with previous releases.

Downloads

Please head to the releases page to download a release of Apache SkyWalking.

Code of conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please follow the REPORTING GUIDELINES to report unacceptable behavior.

Live Demo

Host in Beijing. Go to demo.

Video on youtube.com

RocketBot UI

Screenshot

Dashboard
Topology Map Trace

Compiling project

Follow this document.

Contact Us

Who Uses SkyWalking?

Hundreds of companies and organizations use SkyWalking for research, production, and commercial product.

The PoweredBy page includes more users of the project. Users are encouraged to add themselves to there.

Landscapes



  

SkyWalking enriches the CNCF CLOUD NATIVE Landscape.


Our project enriches the OpenAPM Landscape!

License

Apache 2.0 License.

About

SkyWalking Coverage extends Apache SkyWalking with runtime code coverage capabilities powered by JaCoCo

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages