Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

An example spring boot app to try out with a Parca Agent deployment.

License

Notifications You must be signed in to change notification settings

parca-dev/spring-boot-example

Repository files navigation

THIS EXAMPLE MOVED INTO parca-dev/parca-demo

Spring boot example

This repo is an example for how a Java application can be profiled with Parca Agent. First deploy Parca and Parca Agent as usual, for example on Kubernetes.

In order for Parca Agent to be able to make sense of the just-in-time compiled code by the Java VM, the Java process needs to comply to the Linux Kernel perf jit-interface. To do this, the java process needs to be started with the following two flags -XX:+PreserveFramePointer and -agentpath:/your/path/to/libperfmap.so where the libperfmap.so agent can be downloaded here.

What the agent does is, it maintains a file in /tmp/perf-PID.map, that contains mappings from memory address to Java class and function names. This is the Linux Kernel perf jit-interface, and when this file is present, Parca Agent will detect that and resolve the otherwise to humans incomprehensible memory addresses to the human readable class and function names.

To run this example Java spring boot app on the same Kubernetes cluster execute:

kubectl run spring-boot-example --image=ghcr.io/parca-dev/spring-boot-example:v0.0.1 --port=8080

The important parts to make this work are:

Roadmap

In the future there will be no need to load the additional agent at all, and everything will happen automatically. Follow parca-dev/praca-agent#1 for the latest status.

Screenshot

An example screenshot of parts of an iciclegraph/flamegraph of data produced with this example:

Screenshot from 2022-01-04 19-02-00

About

An example spring boot app to try out with a Parca Agent deployment.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published