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, no recompilation required. The agent uses bytecode instrumentation (via ASM/ByteBuddy) to hook into your running classes and connects to the HyperProbe broker over gRPC to receive probe instructions and report telemetry.

Requirements

  • Java 8 or later (compiled with -source 1.8 -target 1.8 compatibility)
  • A running HyperProbe broker (URL provided by your team or HyperProbe cloud setup)
  • The hyperprobe-agent.jar file (download from your HyperProbe dashboard or CI artifact store)
  • The git commit SHA of the deployed build

How the agent works

When you attach the JAR with -javaagent, the JVM calls the agent’s premain method before your application’s main method runs. The agent then:
  1. Reads configuration from system properties or environment variables.
  2. Connects to the HyperProbe broker over gRPC.
  3. Instruments your classes at load time using ASM/ByteBuddy bytecode transformations.
  4. Listens for probe instructions from the broker and captures telemetry when probed lines execute.
Your application code remains untouched. There are no annotations to add, no SDK calls to make, and no changes to your build process.

Attaching the agent

Add the -javaagent flag to your JVM startup command, followed by the required configuration as system properties:
java \
  -javaagent:/opt/hyperprobe/hyperprobe-agent.jar \
  -Dhyperprobe.serviceId=payment-service \
  -Dhyperprobe.environment=production \
  -Dhyperprobe.brokerUrl=grpc://hyperprobe-broker.internal:50051 \
  -Dhyperprobe.commitSha=${GIT_COMMIT} \
  -jar your-application.jar
A valid commitSha is required. The agent uses it to resolve source maps and match probe positions to the exact version of code deployed. If commitSha is missing or invalid, the agent will not activate. Set the GIT_COMMIT environment variable in your deployment pipeline and reference it as shown above.

Configuration

The Java agent reads configuration from JVM system properties (-D flags). The property names mirror the concepts from the Node.js SDK. All safety guardrail and data control values can also be set via environment variables — environment variables take precedence over system properties.

Required properties

System propertyEnvironment variableDescription
hyperprobe.serviceIdIdentifier for your service (e.g., payment-service)
hyperprobe.environmentDeployment environment (e.g., production, staging)
hyperprobe.brokerUrlgRPC broker URL (e.g., grpc://broker.internal:50051)
hyperprobe.commitShaGIT_COMMITGit commit SHA of the deployed build

Safety guardrails

System propertyEnvironment variableDefaultDescription
hyperprobe.hitsPerSecHYPERPROBE_HITS_SEC10Maximum probe hits per second before the agent throttles
hyperprobe.bandwidthKbPerSecHYPERPROBE_BANDWIDTH_KB_SEC200Maximum telemetry bandwidth in KB/s
hyperprobe.maxLagMsHYPERPROBE_MAX_LAG_MS50Maximum acceptable instrumentation lag in ms before the safety shield activates
hyperprobe.pauseBudgetMsHYPERPROBE_PAUSE_BUDGET_MS20Maximum total pause time per second in ms
hyperprobe.cooldownSecHYPERPROBE_COOLDOWN_SEC10Cooldown period in seconds after the safety shield triggers
hyperprobe.syncIntervalMsHYPERPROBE_SYNC_INTERVAL_MS60000How often (in ms) the agent syncs probe state with the broker

Data controls

System propertyEnvironment variableDefaultDescription
hyperprobe.redactKeysHYPERPROBE_REDACT_KEYSSee belowComma-separated list of field names to auto-redact from snapshots
hyperprobe.redactValuesHYPERPROBE_REDACT_VALUESComma-separated list of values to redact
hyperprobe.maxObjectDepthHYPERPROBE_MAX_OBJECT_DEPTH3Maximum depth for serializing nested objects
hyperprobe.maxArrayLengthHYPERPROBE_MAX_ARRAY_LENGTH3Maximum number of array elements captured
hyperprobe.stackFrameDepthHYPERPROBE_STACK_FRAME_DEPTH3Number of stack frames included in snapshots
hyperprobe.maxObjectPropertiesHYPERPROBE_MAX_OBJECT_PROPERTIES50Maximum number of object properties captured
hyperprobe.maxStringLengthHYPERPROBE_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.redactKeys or HYPERPROBE_REDACT_KEYS.

Examples

java \
  -javaagent:/opt/hyperprobe/hyperprobe-agent.jar \
  -Dhyperprobe.serviceId=order-service \
  -Dhyperprobe.environment=production \
  -Dhyperprobe.brokerUrl=grpc://hyperprobe-broker.internal:50051 \
  -Dhyperprobe.commitSha=${GIT_COMMIT} \
  -Dhyperprobe.hitsPerSec=20 \
  -Dhyperprobe.redactKeys=password,secret,token,ssn \
  -jar order-service.jar

Spring Boot and application servers

For Spring Boot applications using the Spring Boot Maven/Gradle plugin, add the JVM argument in your launch configuration:
pom.xml
<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
  <configuration>
    <jvmArguments>
      -javaagent:/opt/hyperprobe/hyperprobe-agent.jar
      -Dhyperprobe.serviceId=my-service
      -Dhyperprobe.environment=production
      -Dhyperprobe.brokerUrl=grpc://hyperprobe-broker.internal:50051
    </jvmArguments>
  </configuration>
</plugin>
For application servers like Tomcat or JBoss, add the -javaagent flag to the JAVA_OPTS or CATALINA_OPTS environment variable in your server startup script. The agent works with any standard JVM process.