Skip to content

Java

The Pyroscope Java integration runs as a Java agent built on async-profiler, attached at JVM startup and configured entirely through environment variables — no code changes.

  • The ingest endpoint: https://otel.kloudmate.com/v1/profiles/pyroscope
  • An API key — go to Settings → API Keys, click Add New, and create an Ingest Key – Backend. Copy it immediately; KloudMate shows it only once.

Download the agent jar from the pyroscope-java releases page and place it alongside your application, or bake it into your container image.

Set the following environment variables, then launch your JVM with the -javaagent flag:

export PYROSCOPE_APPLICATION_NAME=my-service
export PYROSCOPE_SERVER_ADDRESS=https://otel.kloudmate.com/v1/profiles/pyroscope
export PYROSCOPE_BASIC_AUTH_USER=KloudMate
export PYROSCOPE_BASIC_AUTH_PASSWORD=YOUR_API_KEY
export PYROSCOPE_FORMAT=collapsed

java -javaagent:pyroscope.jar -jar my-app.jar

Swap my-service for a name that identifies this deployment, and YOUR_API_KEY for the key you copied above.

Open Profiling → All Services, select cpu from the profile type dropdown, and give it a minute. Your service’s card appears with a live chart as soon as the first samples land.

If nothing shows up, double-check PYROSCOPE_BASIC_AUTH_USER is set — a missing username is the most common cause of a silent 401.