Skip to main content
HyperProbe supports Kotlin/JVM applications through the same agent used for Java. Attach the agent at startup to capture variables, stack frames, metrics, and logs without adding an initializer or annotations.

Technical prerequisites

  • Runtime: Kotlin/JVM on Java 17 or later. This guide does not apply to Kotlin/JS or Kotlin/Native.
  • Metadata: The Git commit SHA used to build your deployed application.
  • Debug information: Preserve source filenames, line numbers, and local variable metadata in your compiled classes so probes can resolve .kt source locations and capture locals.

Installation

Download the agent JAR. Replace <LATEST_VERSION> with a version from Maven Central:
You do not need a separate Kotlin SDK dependency. Adding the JAR as an application dependency alone does not activate the agent; you must pass -javaagent to the application JVM.

Initialization walkthrough

1

Set environment variables

Export these variables before starting your application. Replace the service ID with the UUID from your HyperProbe dashboard:
Use git rev-parse HEAD for local runs. In CI/CD, set GIT_COMMIT to the commit used to build the deployed artifact. The agent does not start if it is missing or set to unknown.
2

Attach the agent

Choose how you start your application. These examples assume the downloaded JAR is in your project root and the environment variables above are set.
Replace build/libs/app.jar with your executable application JAR.
Keep your existing Kotlin main function unchanged. The agent starts before your application.

Docker deployment

Copy the downloaded agent and your built application into the image. Adjust the application JAR path to match your build output:
Dockerfile
Build and run locally with the environment variables from the initialization step:

Configuration and environment variables

Kotlin uses the same environment variables and defaults as Java. See the complete environment variable reference for performance limits, capture depth, redaction, logging, and trace ID hooks. To disable the agent at startup, set HYPERPROBE_DISABLED=YES.