nopanic-otel
OpenTelemetry metrics, span events and live gauges for nopanic resilience policies.
pip install nopanic-otel
import nopanic_otel
from nopanic import circuit_breaker, bulkhead
payments = circuit_breaker(name="payments")
reports = bulkhead(20, name="reports")
nopanic_otel.instrument() # every event: counter + span event
nopanic_otel.observe(payments, reports) # live gauges, read on each collection
Configure the OpenTelemetry SDK (providers and exporters) as usual; this package only needs opentelemetry-api.
What you get
instrument() turns every nopanic event into:
nopanic.events(counter), with attributesnopanic.kind(e.g.retry.attempt_failed,breaker.state_change),nopanic.policy,nopanic.nameandcode.function;nopanic.retry.delayandnopanic.ratelimit.wait(histograms, seconds);- an event on the current span (
nopanic.retry.attempt_failed,nopanic.breaker.rejected, ...) carrying the event data, so each trace shows the retries, rejections and transitions that happened inside that request.
Pass metrics_enabled=False or span_events=False to keep only one side, and meter_provider= to use a specific provider.
observe(*policies) registers observable gauges:
| Gauge | Source |
|---|---|
nopanic.breaker.state |
0 closed, 1 half_open, 2 open, 3 forced_open, 4 disabled |
nopanic.breaker.failure_rate, .slow_call_rate, .calls |
breaker.metrics |
nopanic.bulkhead.in_flight |
bulkhead.in_flight |
nopanic.ratelimit.available_tokens, nopanic.ratelimit.rate |
rate limiters (rate: adaptive only) |
nopanic.timeout.abandoned |
sync timeout workers still running |
nopanic.cache.size |
cache.size |
nopanic.retry_budget.available |
RetryBudget.available |
keyed policies are expanded: each instance is reported with a nopanic.key attribute. Both functions return a callable that undoes them.
License
MIT.
Metadata
Release files for nopanic-otel 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nopanic_otel-0.1.0.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nopanic_otel-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / nopanic_otel-0.1.0.tar.gz
| Download URL | nopanic_otel-0.1.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
65ef2a0e7815704ff7023f4779f4ecdc89c259514adc2678ec4345ec28cf364e
|
|
BLAKE2b-256 checksum How to use checksums |
8e0fd040210da4c5d36b818e37ae3fb58470b5764cd36c3742753dafef0c3916
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.6
|
Release files / nopanic_otel-0.1.0-py3-none-any.whl
| Download URL | nopanic_otel-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64a74198c31405556cf06867055976db8ff7a21db0a132a49dc58f96443aa125
|
|
BLAKE2b-256 checksum How to use checksums |
796511dd59e7c1298672b04e479a226e65d52d086f62ac2f29b3aefd74a5bbf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.6
|