Error-tracking SDK for Python — captures errors and reports them to a Tiden project.
Project description
tiden-telemetry (Python)
Error-tracking SDK for Python apps. Captures errors and uncaught exceptions
and reports them to your Tiden project, with WSGI middleware
and a logging handler. Zero dependencies (standard library only), typed.
Install
pip install tiden-telemetry
Quick start
import tiden_telemetry as tiden
tiden.init(
dsn="http://<publicKey>@<host:ingestPort>/<projectId>",
release="my-app@1.2.3",
environment="production",
)
try:
do_work()
except Exception:
tiden.capture_exception() # inside an except block, no argument needed
init installs sys.excepthook / threading.excepthook, so uncaught
exceptions are reported automatically.
Capturing
tiden.capture_exception(err)
tiden.capture_message("checkout completed", "info")
tiden.set_tag("plan", "pro")
tiden.set_user({"id": "u_123"})
WSGI middleware
Captures unhandled exceptions in your app, then re-raises (so the server's own error handling still runs):
from tiden_telemetry.wsgi import TidenWsgiMiddleware
application = TidenWsgiMiddleware(application)
The captured event includes request URL, method, and headers (sensitive headers
are scrubbed unless send_default_pii is set).
logging handler
Route records (≥ ERROR by default) through Tiden — logger.exception(...)
becomes a captured exception:
import logging
from tiden_telemetry.logging import TidenLoggingHandler
logging.getLogger().addHandler(TidenLoggingHandler())
Options
tiden.init(...) / tiden.Client(...):
| Option | Type | Default | Description |
|---|---|---|---|
dsn |
str |
— | Required. http://<publicKey>@<host:ingestPort>/<projectId>. |
release |
str |
None |
App version, e.g. my-app@1.2.3. |
environment |
str |
None |
e.g. production, staging. |
send_default_pii |
bool |
False |
Send likely-PII. Off by default — common PII is scrubbed. |
before_send |
Callable[[dict], dict | None] |
None |
Inspect, mutate, or drop an event. Return None to drop. |
http_timeout |
float |
2.0 |
Bounds each synchronous send (seconds). |
install_excepthook |
bool |
True (init) |
Install global excepthooks. |
Use tiden.Client(...) directly for multiple clients or to avoid global state;
pass it to TidenWsgiMiddleware(app, client=...) / TidenLoggingHandler(client=...).
How it works
- Parses the DSN to
/api/<projectId>/envelope/?tiden_key=…. - Normalizes exceptions (incl. the
__cause__/__context__chain) intoexception.values[]with stack frames (in_appexcludes the stdlib and site-packages). - Serializes the envelope and POSTs it with
Content-Type: application/x-tiden-envelope— synchronous, never raises into the host; honors HTTP 429 +Retry-After. - Scrubs likely-PII (auth headers, secret-ish keys) unless
send_default_pii.
Develop
pip install -e ".[dev]"
ruff check . && ruff format --check .
mypy
pytest -q
License
MIT © Tiden
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 tiden_telemetry-0.1.0.tar.gz.
File metadata
- Download URL: tiden_telemetry-0.1.0.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66dba9d90fcbd7ccb61ad992a182011e712a9b32299cac548d799c9108bcacbf
|
|
| MD5 |
0c234ca1fddad58c31511db05c2f8abf
|
|
| BLAKE2b-256 |
f6b1161fe113c71e56c5f2be88d43a7d85cb29d9785e7042ad9ab4b2c3bb7ca6
|
Provenance
The following attestation bundles were made for tiden_telemetry-0.1.0.tar.gz:
Publisher:
publish.yml on qase-tms/tiden-telemetry-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tiden_telemetry-0.1.0.tar.gz -
Subject digest:
66dba9d90fcbd7ccb61ad992a182011e712a9b32299cac548d799c9108bcacbf - Sigstore transparency entry: 1781346023
- Sigstore integration time:
-
Permalink:
qase-tms/tiden-telemetry-python@cecfb444d6c215281c96d784fee46a0291c8635e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/qase-tms
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cecfb444d6c215281c96d784fee46a0291c8635e -
Trigger Event:
push
-
Statement type:
File details
Details for the file tiden_telemetry-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tiden_telemetry-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7eb5f6d1862d3fed4272d3423a20b5a2e444ccce9637b60c595ad2769e316ef
|
|
| MD5 |
eeb574f0d8670916d704f5545ecf6a57
|
|
| BLAKE2b-256 |
05b0f60ded1a0f441ba30625ee12bb6a3de448e1eade50c852d572d2e1ad7ae0
|
Provenance
The following attestation bundles were made for tiden_telemetry-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on qase-tms/tiden-telemetry-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tiden_telemetry-0.1.0-py3-none-any.whl -
Subject digest:
d7eb5f6d1862d3fed4272d3423a20b5a2e444ccce9637b60c595ad2769e316ef - Sigstore transparency entry: 1781346186
- Sigstore integration time:
-
Permalink:
qase-tms/tiden-telemetry-python@cecfb444d6c215281c96d784fee46a0291c8635e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/qase-tms
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cecfb444d6c215281c96d784fee46a0291c8635e -
Trigger Event:
push
-
Statement type: