hyperprobe-agent 1.2.25b9__tar.gz → 1.2.26__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/PKG-INFO +33 -26
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/README.md +32 -25
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/agent.py +295 -27
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/broker.py +2 -2
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/safety.py +68 -19
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe_agent.egg-info/PKG-INFO +33 -26
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe_agent.egg-info/SOURCES.txt +4 -5
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/setup.py +1 -6
- hyperprobe_agent-1.2.26/tests/test_fork.py +276 -0
- hyperprobe_agent-1.2.26/tests/test_safety.py +149 -0
- hyperprobe_agent-1.2.26/tests/test_startup.py +110 -0
- hyperprobe_agent-1.2.25b9/hyperprobe/bootstrap.py +0 -40
- hyperprobe_agent-1.2.25b9/hyperprobe/core/injection/__init__.py +0 -0
- hyperprobe_agent-1.2.25b9/hyperprobe/core/injection/sitecustomize.py +0 -18
- hyperprobe_agent-1.2.25b9/hyperprobe_agent.egg-info/entry_points.txt +0 -2
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/LICENSE +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/__init__.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/__init__.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/evaluator.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/logger.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/monitoring_engine.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/probe_output.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/quota.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/serializer.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/core/trace_extractor.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/protos/__init__.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/protos/agent_pb2.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe/protos/agent_pb2_grpc.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe_agent.egg-info/dependency_links.txt +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe_agent.egg-info/requires.txt +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/hyperprobe_agent.egg-info/top_level.txt +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/setup.cfg +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/tests/test_agent.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/tests/test_evaluator.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/tests/test_logger.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/tests/test_metric_probes.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/tests/test_multithreading_integration.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/tests/test_p1_regressions.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/tests/test_probe_output.py +0 -0
- {hyperprobe_agent-1.2.25b9 → hyperprobe_agent-1.2.26}/tests/test_serializer.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hyperprobe-agent
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.26
|
|
4
4
|
Summary: Production-grade, non-breaking live debugger and telemetry agent for Python.
|
|
5
5
|
Home-page: https://www.hyperprobe.co
|
|
6
6
|
Author: Arif, Saksham, Karan
|
|
@@ -46,7 +46,6 @@ HyperProbe allows you to debug running Python applications in real-time without
|
|
|
46
46
|
- **Counter Probes:** Emit a value of `1` whenever a configured source line is reached.
|
|
47
47
|
- **Metric Probes:** Safely evaluate a numerical Python expression and emit its value.
|
|
48
48
|
- **Duration Probes:** Measure elapsed monotonic time in milliseconds between two source lines, with optional request correlation.
|
|
49
|
-
- **Zero-Code-Change Auto-Instrumentation:** Prepend our bootstrap runtime to any Python process without editing your application's code.
|
|
50
49
|
- **Circular Reference & Deep Object Protection:** Memory-safe serialization of deeply nested or cyclic variables.
|
|
51
50
|
- **High-Performance Safety Guard:** Automatically pauses monitoring and goes idle if CPU/memory boundaries or pause budgets are exceeded.
|
|
52
51
|
|
|
@@ -74,16 +73,24 @@ pip install hyperprobe-agent
|
|
|
74
73
|
|
|
75
74
|
## Usage
|
|
76
75
|
|
|
77
|
-
|
|
76
|
+
Start the agent programmatically at your application's entrypoint:
|
|
78
77
|
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
```python
|
|
79
|
+
import os
|
|
80
|
+
from hyperprobe import HyperProbe
|
|
81
|
+
|
|
82
|
+
agent = HyperProbe.start({
|
|
83
|
+
"service_id": "<service-uuid-from-dashboard>",
|
|
84
|
+
"environment": os.getenv("PYTHON_ENV"),
|
|
85
|
+
"broker_url": "https://logger.app.hyperprobe.co",
|
|
86
|
+
"commit_sha": os.getenv("GIT_COMMIT"),
|
|
87
|
+
})
|
|
85
88
|
```
|
|
86
89
|
|
|
90
|
+
Required identity values may also be supplied through the environment variables
|
|
91
|
+
below. Explicit options take precedence. Initialization failures are reported
|
|
92
|
+
and the application continues without instrumentation.
|
|
93
|
+
|
|
87
94
|
### Configuration Environment Variables
|
|
88
95
|
|
|
89
96
|
Configure the agent using the following environment variables:
|
|
@@ -102,7 +109,7 @@ Configure the agent using the following environment variables:
|
|
|
102
109
|
| `HYPERPROBE_BANDWIDTH_KB_PER_SEC` | Max bandwidth limit for telemetry transmissions (quota). | `1024` (1 MB) |
|
|
103
110
|
| `HYPERPROBE_RPC_TIMEOUT_SEC` | Deadline for broker RPCs. | `10` |
|
|
104
111
|
| `HYPERPROBE_COOLDOWN_SEC` | Tracing suspension duration after a RED safety state. | `10` |
|
|
105
|
-
| `HYPERPROBE_MAX_LAG_MS` |
|
|
112
|
+
| `HYPERPROBE_MAX_LAG_MS` | Per-reading scheduler-lag threshold. YELLOW requires 4/10 breaches; RED requires 7/10 breaches or 3/5 readings above 4x the threshold. | `50` |
|
|
106
113
|
| `HYPERPROBE_PAUSE_BUDGET_MS` | Per-second capture pause budget for the safety monitor. | `15` |
|
|
107
114
|
| `HYPERPROBE_REDACT_KEYS` | Comma-separated key patterns to redact. | `password,secret,token,authorization,cookie,key,signature` |
|
|
108
115
|
| `HYPERPROBE_REDACT_VALUES` | Comma-separated value patterns to redact. | *(empty)* |
|
|
@@ -111,6 +118,7 @@ Configure the agent using the following environment variables:
|
|
|
111
118
|
| `HYPERPROBE_STACK_FRAME_DEPTH` | Maximum captured stack-frame depth. | `3` |
|
|
112
119
|
| `HYPERPROBE_MAX_OBJECT_PROPERTIES` | Maximum serialized properties per object. | `50` |
|
|
113
120
|
| `HYPERPROBE_MAX_STRING_LENGTH` | Maximum serialized string length. | `1024` |
|
|
121
|
+
| `HYPERPROBE_FORK_MODE` | Set to `worker` for preloaded, prefork servers. The parent defers agent initialization and every worker starts fresh process-local state. | `none` |
|
|
114
122
|
|
|
115
123
|
### Debug logging
|
|
116
124
|
|
|
@@ -118,9 +126,9 @@ Set `DEBUG` to a comma- or space-separated list of namespaces. Patterns accept
|
|
|
118
126
|
`*`, and exclusions begin with `-`:
|
|
119
127
|
|
|
120
128
|
```bash
|
|
121
|
-
DEBUG=hyperprobe
|
|
129
|
+
DEBUG=hyperprobe:* # all HyperProbe SDK logs
|
|
122
130
|
DEBUG=hyperprobe:broker,hyperprobe:monitor # selected components
|
|
123
|
-
DEBUG=hyperprobe
|
|
131
|
+
DEBUG=hyperprobe:*,-hyperprobe:evaluator # exclude a component
|
|
124
132
|
DEBUG_COLORS=1 # force ANSI colors
|
|
125
133
|
```
|
|
126
134
|
|
|
@@ -129,26 +137,25 @@ Without `*`, a selector is exact: `DEBUG=hyperprobe` does not match
|
|
|
129
137
|
Set `DEBUG_COLORS=0` to disable colors. Logging configuration is read during
|
|
130
138
|
SDK initialization, so set these variables before starting the process.
|
|
131
139
|
|
|
132
|
-
##
|
|
140
|
+
## Shutdown
|
|
133
141
|
|
|
134
|
-
|
|
142
|
+
Call `HyperProbe.shutdown()` when the application process stops to close
|
|
143
|
+
monitoring, workers, and the broker connection cleanly.
|
|
135
144
|
|
|
136
|
-
|
|
145
|
+
For servers that import the application before forking workers, such as
|
|
146
|
+
Gunicorn with `--preload`, enable worker fork mode:
|
|
137
147
|
|
|
138
148
|
```python
|
|
139
|
-
import os
|
|
140
|
-
from hyperprobe import HyperProbe
|
|
141
|
-
|
|
142
|
-
# Start the agent programmatically at your application's entrypoint
|
|
143
149
|
agent = HyperProbe.start({
|
|
144
150
|
"service_id": "<service-uuid-from-dashboard>",
|
|
145
|
-
"environment": os.getenv("PYTHON_ENV"),
|
|
151
|
+
"environment": os.getenv("PYTHON_ENV"),
|
|
146
152
|
"broker_url": "https://logger.app.hyperprobe.co",
|
|
147
|
-
"commit_sha": os.getenv("GIT_COMMIT"),
|
|
153
|
+
"commit_sha": os.getenv("GIT_COMMIT"),
|
|
154
|
+
"fork_mode": "worker",
|
|
148
155
|
})
|
|
149
|
-
|
|
150
|
-
# Your application code goes here...
|
|
151
|
-
|
|
152
|
-
# To cleanly shut down the agent when your app stops:
|
|
153
|
-
HyperProbe.shutdown()
|
|
154
156
|
```
|
|
157
|
+
|
|
158
|
+
The prefork parent remains agent-free. Every worker receives a unique agent ID,
|
|
159
|
+
telemetry queue, gRPC channel, monitoring engine, and set of background threads.
|
|
160
|
+
Application code running inside those workers must use the `spawn` process start
|
|
161
|
+
method rather than creating additional children with `fork`.
|
|
@@ -11,7 +11,6 @@ HyperProbe allows you to debug running Python applications in real-time without
|
|
|
11
11
|
- **Counter Probes:** Emit a value of `1` whenever a configured source line is reached.
|
|
12
12
|
- **Metric Probes:** Safely evaluate a numerical Python expression and emit its value.
|
|
13
13
|
- **Duration Probes:** Measure elapsed monotonic time in milliseconds between two source lines, with optional request correlation.
|
|
14
|
-
- **Zero-Code-Change Auto-Instrumentation:** Prepend our bootstrap runtime to any Python process without editing your application's code.
|
|
15
14
|
- **Circular Reference & Deep Object Protection:** Memory-safe serialization of deeply nested or cyclic variables.
|
|
16
15
|
- **High-Performance Safety Guard:** Automatically pauses monitoring and goes idle if CPU/memory boundaries or pause budgets are exceeded.
|
|
17
16
|
|
|
@@ -39,16 +38,24 @@ pip install hyperprobe-agent
|
|
|
39
38
|
|
|
40
39
|
## Usage
|
|
41
40
|
|
|
42
|
-
|
|
41
|
+
Start the agent programmatically at your application's entrypoint:
|
|
43
42
|
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
```python
|
|
44
|
+
import os
|
|
45
|
+
from hyperprobe import HyperProbe
|
|
46
|
+
|
|
47
|
+
agent = HyperProbe.start({
|
|
48
|
+
"service_id": "<service-uuid-from-dashboard>",
|
|
49
|
+
"environment": os.getenv("PYTHON_ENV"),
|
|
50
|
+
"broker_url": "https://logger.app.hyperprobe.co",
|
|
51
|
+
"commit_sha": os.getenv("GIT_COMMIT"),
|
|
52
|
+
})
|
|
50
53
|
```
|
|
51
54
|
|
|
55
|
+
Required identity values may also be supplied through the environment variables
|
|
56
|
+
below. Explicit options take precedence. Initialization failures are reported
|
|
57
|
+
and the application continues without instrumentation.
|
|
58
|
+
|
|
52
59
|
### Configuration Environment Variables
|
|
53
60
|
|
|
54
61
|
Configure the agent using the following environment variables:
|
|
@@ -67,7 +74,7 @@ Configure the agent using the following environment variables:
|
|
|
67
74
|
| `HYPERPROBE_BANDWIDTH_KB_PER_SEC` | Max bandwidth limit for telemetry transmissions (quota). | `1024` (1 MB) |
|
|
68
75
|
| `HYPERPROBE_RPC_TIMEOUT_SEC` | Deadline for broker RPCs. | `10` |
|
|
69
76
|
| `HYPERPROBE_COOLDOWN_SEC` | Tracing suspension duration after a RED safety state. | `10` |
|
|
70
|
-
| `HYPERPROBE_MAX_LAG_MS` |
|
|
77
|
+
| `HYPERPROBE_MAX_LAG_MS` | Per-reading scheduler-lag threshold. YELLOW requires 4/10 breaches; RED requires 7/10 breaches or 3/5 readings above 4x the threshold. | `50` |
|
|
71
78
|
| `HYPERPROBE_PAUSE_BUDGET_MS` | Per-second capture pause budget for the safety monitor. | `15` |
|
|
72
79
|
| `HYPERPROBE_REDACT_KEYS` | Comma-separated key patterns to redact. | `password,secret,token,authorization,cookie,key,signature` |
|
|
73
80
|
| `HYPERPROBE_REDACT_VALUES` | Comma-separated value patterns to redact. | *(empty)* |
|
|
@@ -76,6 +83,7 @@ Configure the agent using the following environment variables:
|
|
|
76
83
|
| `HYPERPROBE_STACK_FRAME_DEPTH` | Maximum captured stack-frame depth. | `3` |
|
|
77
84
|
| `HYPERPROBE_MAX_OBJECT_PROPERTIES` | Maximum serialized properties per object. | `50` |
|
|
78
85
|
| `HYPERPROBE_MAX_STRING_LENGTH` | Maximum serialized string length. | `1024` |
|
|
86
|
+
| `HYPERPROBE_FORK_MODE` | Set to `worker` for preloaded, prefork servers. The parent defers agent initialization and every worker starts fresh process-local state. | `none` |
|
|
79
87
|
|
|
80
88
|
### Debug logging
|
|
81
89
|
|
|
@@ -83,9 +91,9 @@ Set `DEBUG` to a comma- or space-separated list of namespaces. Patterns accept
|
|
|
83
91
|
`*`, and exclusions begin with `-`:
|
|
84
92
|
|
|
85
93
|
```bash
|
|
86
|
-
DEBUG=hyperprobe
|
|
94
|
+
DEBUG=hyperprobe:* # all HyperProbe SDK logs
|
|
87
95
|
DEBUG=hyperprobe:broker,hyperprobe:monitor # selected components
|
|
88
|
-
DEBUG=hyperprobe
|
|
96
|
+
DEBUG=hyperprobe:*,-hyperprobe:evaluator # exclude a component
|
|
89
97
|
DEBUG_COLORS=1 # force ANSI colors
|
|
90
98
|
```
|
|
91
99
|
|
|
@@ -94,26 +102,25 @@ Without `*`, a selector is exact: `DEBUG=hyperprobe` does not match
|
|
|
94
102
|
Set `DEBUG_COLORS=0` to disable colors. Logging configuration is read during
|
|
95
103
|
SDK initialization, so set these variables before starting the process.
|
|
96
104
|
|
|
97
|
-
##
|
|
105
|
+
## Shutdown
|
|
98
106
|
|
|
99
|
-
|
|
107
|
+
Call `HyperProbe.shutdown()` when the application process stops to close
|
|
108
|
+
monitoring, workers, and the broker connection cleanly.
|
|
100
109
|
|
|
101
|
-
|
|
110
|
+
For servers that import the application before forking workers, such as
|
|
111
|
+
Gunicorn with `--preload`, enable worker fork mode:
|
|
102
112
|
|
|
103
113
|
```python
|
|
104
|
-
import os
|
|
105
|
-
from hyperprobe import HyperProbe
|
|
106
|
-
|
|
107
|
-
# Start the agent programmatically at your application's entrypoint
|
|
108
114
|
agent = HyperProbe.start({
|
|
109
115
|
"service_id": "<service-uuid-from-dashboard>",
|
|
110
|
-
"environment": os.getenv("PYTHON_ENV"),
|
|
116
|
+
"environment": os.getenv("PYTHON_ENV"),
|
|
111
117
|
"broker_url": "https://logger.app.hyperprobe.co",
|
|
112
|
-
"commit_sha": os.getenv("GIT_COMMIT"),
|
|
118
|
+
"commit_sha": os.getenv("GIT_COMMIT"),
|
|
119
|
+
"fork_mode": "worker",
|
|
113
120
|
})
|
|
114
|
-
|
|
115
|
-
# Your application code goes here...
|
|
116
|
-
|
|
117
|
-
# To cleanly shut down the agent when your app stops:
|
|
118
|
-
HyperProbe.shutdown()
|
|
119
121
|
```
|
|
122
|
+
|
|
123
|
+
The prefork parent remains agent-free. Every worker receives a unique agent ID,
|
|
124
|
+
telemetry queue, gRPC channel, monitoring engine, and set of background threads.
|
|
125
|
+
Application code running inside those workers must use the `spawn` process start
|
|
126
|
+
method rather than creating additional children with `fork`.
|