Technical Prerequisites
- Standard Ruby (CRuby): Ruby 3.0 and later.
- JRuby (Ruby on JVM): JRuby 9.3 and later on Java 11 or later (Java 17, 21, and 25 supported). Requires the JIT-preserving tracing profile in
JRUBY_OPTS. - Metadata: Access to the active git commit SHA (mandatory for matching local source coordinates to production builds).
Installation
Add the SDK as a dependency using your package manager:gem 'hyperprobe-agent' directly to your Gemfile, run:
Initialization Walkthrough
Follow these steps to initialize the HyperProbe agent inside your application:1
Create your initialization file
Create a dedicated file named
hyperprobe.rb in your project root:hyperprobe.rb
2
Import it in your entrypoint
In your main application entrypoint (such as
config/environment.rb for Rails, or app.rb / server.rb for Sinatra / Rack), require hyperprobe as early as possible before starting your application:3
Configure multi-worker servers (Puma / Unicorn)
If you run a multi-process web server like Puma or Unicorn in clustered mode (with forked workers) on standard Ruby (CRuby), add
defer_start: true to your initializer and call HyperProbe.after_fork in your worker boot configuration:config/puma.rb
4
Configure your Dockerfile
To enable Docker-based deployments, define a
GIT_COMMIT build argument inside your Dockerfile with a default value of unknown.If you are running JRuby, also set the JRUBY_OPTS environment variable to preserve variable scopes with JIT enabled:- Standard Ruby (CRuby)
- JRuby (Ruby on JVM)
Dockerfile
5
Run local Docker builds
For building and testing Docker containers locally, inject your active git commit:
6
Inject correct SHA in CI/CD (The PR Merge Trap)
To protect source alignment, HyperProbe refuses to start if
commit_sha resolves to unknown. Pass the real commit SHA to GIT_COMMIT during deployment.Always use your CI/CD platform’s native commit SHA variable:☕ JRuby Support (Ruby on the JVM)
HyperProbe provides native, first-class support for JRuby applications running on the JVM.Prerequisites for JRuby
- JRuby Version: JRuby 9.3 and later (Java 8 is not supported; JRuby 10.1 requires Java 21+).
- Java Runtime: Java 11, 17, 21, or 25.
- Launch Profile: JRuby must be launched with the required JIT-preserving tracing profile:
Why the Launch Profile is Required on JRuby
JRuby’s JIT compiler optimizes hot methods into raw JVM bytecode, stripping out line-level checkpoints and local variable names by default. Passing this profile instructs JRuby to retain line checkpoints and local variable scopes without disabling JIT compilation, so probes trigger reliably on compiled methods.How to Launch JRuby with HyperProbe
- Docker / Kubernetes
- CLI / Local Server
Add the environment variable inside your
Dockerfile or Deployment manifest:Dockerfile
Configuration & Environment Variables Reference
You can configure the agent by passing properties inside yourHyperProbe.start() options hash, or by using environment variables.
The following example includes the available programmatic options and their corresponding environment variables:
hyperprobe.rb
stack_frame_depth. On JRuby, only the hit frame has locals; caller frames show {}.
Safe evaluation
Safe evaluation is enabled by default on Ruby and JRuby. To allow custom method calls in probe expressions, opt in before starting your application:disable_safe_evaluation: true to your existing HyperProbe.start options. An explicit false keeps safe evaluation enabled, even if the environment variable is true.
Safety shields
The SDK automatically suspends probes when its safety limits are exceeded:- CRuby: Uses repeated thread-lag readings and a probe-handler time budget (default 15 ms per second).
- JRuby: Checks JVM heap headroom every 5 seconds. Below 15% of maximum heap triggers a warning; below 5% suspends probes. Timing-budget breaches do not log warnings or suspend probes.
- Auto-recovery: Resumes probes after the cooldown period (default 10 seconds), once health returns to GREEN.
