Stimpact Python telemetry SDK
Project description
Stimpact Python SDK
The Python SDK sends runtime exceptions to the Stimpact agent platform using a project-scoped API key.
Capture contract
Use Stimpact in two layers:
- auto-capture for uncaught process and thread exceptions with
install_auto_capture() - handled-error capture for exceptions you catch deliberately with
capture_handled_exception(),wrap(), orwrap_async()
Transport failures still raise StimpactRequestError, but the auto-capture hooks swallow those reporting failures so they do not create recursive exception loops.
Install
pip install stimpact-sdk
Basic usage
from stimpact_sdk import StimpactClient
client = StimpactClient.from_env(
service="billing-api",
environment="production",
)
client.install_auto_capture()
try:
charge_customer()
except Exception as exc:
client.capture_handled_exception(
exc,
request={"method": "POST", "url": "/api/charge"},
)
raise
Wrapped operations
For synchronous work:
client.wrap(lambda: charge_customer(), request={"method": "POST", "url": "/api/charge"})
For async work:
await client.wrap_async(
lambda: charge_customer_async(),
request={"method": "POST", "url": "/api/charge"},
)
When your framework already catches and renders exceptions, capture them once in the shared request or task boundary rather than in every individual UI or business-logic call site.
Environment variables
STIMPACT_BASE_URLSTIMPACT_PROJECT_IDSTIMPACT_API_KEYSTIMPACT_SERVICESTIMPACT_ENVIRONMENT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stimpact_sdk-0.3.0.tar.gz.
File metadata
- Download URL: stimpact_sdk-0.3.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ee71e3d1b836e1b80307cc8b66045c056837f06d69b5221504a4a9bbb1095a
|
|
| MD5 |
8cc04e854f6f18bac7fd5a7a5636d2f8
|
|
| BLAKE2b-256 |
657feb3d235ff63fd04643c186f64e25b64474ca5f169b99b1256236126075d0
|
File details
Details for the file stimpact_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: stimpact_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a067882ca6b5f134c4bf71869f6c8f783b2249f8a27714991e77c5e22c495d7f
|
|
| MD5 |
4997948877390f41af44db1d002890e4
|
|
| BLAKE2b-256 |
f585b1714acba9b8b9e44061c69c679375d0b8fc8487d53666badf6b55c35418
|