Skip to main content
The HyperProbe Java agent is a standard JVM instrumentation agent. You attach it to your application at startup with the -javaagent JVM flag — no code changes, no framework wrappers, and no recompilation required.

Prerequisites

  • Java 11 or later (compatible with standard JVMs)
  • A running HyperProbe broker (URL provided by your team or HyperProbe cloud setup)
  • The hyperprobe-agent.jar file (downloaded from your HyperProbe dashboard or CI artifact store)
  • The git commit SHA of the deployed build (required for coordinate resolution)

How the agent works

When you attach the JAR with -javaagent, the JVM calls the agent’s initialisation sequence before your application’s main method runs. To ensure zero interference with your application, the agent:
  1. Starts in an isolated, child-first classloader (preventing dependency conflicts).
  2. Reads configuration strictly from environment variables.
  3. Connects to the HyperProbe broker over gRPC.
  4. Instruments your classes at load time using non-intrusive bytecode transformations.
  5. Listens for probe instructions and captures telemetry when probed lines execute.
Your application code remains entirely untouched. There are no annotations to add, no SDK methods to call, and no changes to your build process.

Attaching the agent

Add the -javaagent flag to your JVM startup command. The Java agent requires configuration to be passed via environment variables to prevent configuration leakage into the host application and to adhere to twelve-factor app principles.
export GIT_COMMIT=$(git rev-parse HEAD)
export HYPERPROBE_SERVICE_ID=uuid-of-the-service-from-dashboard
export HYPERPROBE_ENVIRONMENT=production
export HYPERPROBE_BROKER_URL=https://logger.app.hyperprobe.co

java -javaagent:/opt/hyperprobe/hyperprobe-agent.jar -jar your-application.jar
A valid GIT_COMMIT is strictly required. The agent uses it to match probe positions to the exact version of the code deployed. If GIT_COMMIT is missing, empty, or set to "unknown", the agent logs a critical error and refuses to start.

Configuration

The agent reads configuration exclusively from environment variables. System properties (-D flags) are intentionally ignored by the agent to ensure strict isolation.

Required variables

Environment variableDescription
HYPERPROBE_SERVICE_IDIdentifier for your service (e.g., uuid of the service from the dashboard)
HYPERPROBE_ENVIRONMENTDeployment environment (e.g., production, staging)
HYPERPROBE_BROKER_URLgRPC broker URL (e.g., https://logger.app.hyperprobe.co)
GIT_COMMITGit commit SHA of the deployed build

Safety guardrails

The Java agent continuously monitors JVM memory health. If free memory drops below 15%, the agent enters a YELLOW state (warning). If free memory drops below 5%, the agent enters a RED state, immediately suspending all instrumentation to protect the host application. Instrumentation automatically resumes after the HYPERPROBE_COOLDOWN_SEC period if memory levels stabilize.
Environment variableDefaultDescription
HYPERPROBE_HITS_PER_SEC20Maximum probe hits per second globally before the agent throttles
HYPERPROBE_BANDWIDTH_KB_PER_SEC1024Maximum telemetry bandwidth in KB/s
HYPERPROBE_COOLDOWN_SEC10Cooldown period in seconds after the memory safety shield triggers
HYPERPROBE_SYNC_INTERVAL_MS60000How often (in ms) the agent syncs probe state with the broker
HYPERPROBE_FLUSH_INTERVAL_MS1000How often (in ms) the agent flushes the telemetry queue to the broker

Data controls

Environment variableDefaultDescription
HYPERPROBE_REDACT_KEYSSee belowComma-separated list of field names to auto-redact from snapshots
HYPERPROBE_REDACT_VALUESComma-separated list of values to redact
HYPERPROBE_MAX_OBJECT_DEPTH3Maximum depth for serializing nested objects
HYPERPROBE_MAX_ARRAY_LENGTH3Maximum number of array elements captured
HYPERPROBE_STACK_FRAME_DEPTH3Number of stack frames included in snapshots
HYPERPROBE_MAX_OBJECT_PROPERTIES50Maximum number of object properties captured
HYPERPROBE_MAX_STRING_LENGTH1024Maximum string length before truncation
The default redacted keys are: password, secret, token, authorization, cookie, key, signature. These are applied automatically. Add your own sensitive field names via HYPERPROBE_REDACT_KEYS to override the defaults.

Optional configuration

Environment variableDefaultDescription
HYPERPROBE_DISABLEDSet to YES to completely skip agent initialization at startup
HYPERPROBE_APP_ROOTDefines the root package or directory to restrict instrumentation scanning

Examples

When deploying via Docker, it is best practice to bake the GIT_COMMIT directly into the image during the build process using build arguments, along with your static configuration.
Dockerfile
FROM eclipse-temurin:21-jre

# Define a build argument for the commit SHA
ARG GIT_COMMIT

COPY hyperprobe-agent.jar /opt/hyperprobe/hyperprobe-agent.jar
COPY order-service.jar /app/order-service.jar

# Bake the dynamic commit and static config into the image
ENV GIT_COMMIT=${GIT_COMMIT}
ENV HYPERPROBE_SERVICE_ID=order-service
ENV HYPERPROBE_ENVIRONMENT=production
ENV HYPERPROBE_BROKER_URL=https://logger.app.hyperprobe.co

ENTRYPOINT ["java", "-javaagent:/opt/hyperprobe/hyperprobe-agent.jar", "-jar", "/app/order-service.jar"]
Pass the build argument when building the image in your CI/CD pipeline:
docker build \
  --build-arg GIT_COMMIT=$(git rev-parse HEAD) \
  -t order-service:latest .
Because the commit is baked in, you can run the container cleanly without runtime variables:
docker run order-service:latest

Framework integrations

The agent hooks into the standard JVM initialization process, so it works seamlessly alongside any Java framework. Provide the -javaagent flag as a standard JVM argument in your build or run tasks.
When running via the Spring Boot Maven plugin, provide the agent path in <jvmArguments> and set configuration in <environmentVariables>.
pom.xml
<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <configuration>
    <jvmArguments>-javaagent:/opt/hyperprobe/hyperprobe-agent.jar</jvmArguments>
    <environmentVariables>
      <HYPERPROBE_SERVICE_ID>my-service</HYPERPROBE_SERVICE_ID>
      <HYPERPROBE_ENVIRONMENT>production</HYPERPROBE_ENVIRONMENT>
      <HYPERPROBE_BROKER_URL>https://logger.app.hyperprobe.co</HYPERPROBE_BROKER_URL>
      <!-- In practice, you might populate this from the git-commit-id-plugin -->
      <GIT_COMMIT>${git.commit.id}</GIT_COMMIT>
    </environmentVariables>
  </configuration>
</plugin>