sys.monitoring APIs to capture variables, stack frames, and logs without blocking your application.
Technical Prerequisites
- Runtime: Python 3.12 and later.
- 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:Initialization Walkthrough
Follow these steps to initialize the HyperProbe agent inside your application:1
Choose an initialization method
Select one of the following initialization methods:
- Code Initialization
- Auto Initialization
Create a dedicated file named
hyperprobe_init.py in your project source root:hyperprobe_init.py
2
Import it in your entrypoint
In your main application file, import
hyperprobe_init as early as possible before starting your application:main.py
3
Configure your Dockerfile
To enable Docker-based deployments, define a
GIT_COMMIT build argument inside your Dockerfile with a default value of unknown:Dockerfile
4
Run local Docker builds
For building and testing Docker containers locally, inject your active git commit:
5
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:Configuration & Environment Variables Reference
You can configure the agent by passing properties inside yourHyperProbe.start() options object, or by using environment variables.
The following example includes the available programmatic options and their corresponding environment variables:
hyperprobe_init.py
Safety Shields
Because dynamic monitoring could affect application performance during heavy execution spikes, the Python Agent includes active Safety Shields:- Yellow Threshold: Logs a warning when execution lag or cumulative pause time reaches 50% of its limit.
- Red Threshold: Suspends tracing when execution lag exceeds 50 ms or cumulative pause time exceeds 15 ms.
- Auto-Recovery: Resumes instrumentation after the cooldown period when application performance stabilizes.
