Skip to main content

Error-tracking SDK for Python — captures errors and reports them to a Tiden project.

Project description

tiden-telemetry (Python)

CI PyPI 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) into exception.values[] with stack frames (in_app excludes the stdlib and site-packages).
  • Serializes the envelope and POSTs it with Content-Type: application/x-tiden-envelopesynchronous, 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tiden_telemetry-0.1.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tiden_telemetry-0.1.0-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

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

Hashes for tiden_telemetry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 66dba9d90fcbd7ccb61ad992a182011e712a9b32299cac548d799c9108bcacbf
MD5 0c234ca1fddad58c31511db05c2f8abf
BLAKE2b-256 f6b1161fe113c71e56c5f2be88d43a7d85cb29d9785e7042ad9ab4b2c3bb7ca6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tiden_telemetry-0.1.0.tar.gz:

Publisher: publish.yml on qase-tms/tiden-telemetry-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for tiden_telemetry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7eb5f6d1862d3fed4272d3423a20b5a2e444ccce9637b60c595ad2769e316ef
MD5 eeb574f0d8670916d704f5545ecf6a57
BLAKE2b-256 05b0f60ded1a0f441ba30625ee12bb6a3de448e1eade50c852d572d2e1ad7ae0

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page