Skip to main content

watchdog-sdk (Python)

Python SDK for Watchdog, the open-source, self-hosted error tracker. It reports unhandled exceptions, logged errors, performance traces and custom metrics to your own Watchdog server.

It has no dependencies, sends in a background thread so it never blocks your code, and works with asyncio, threads and multi-process workers.

pip install watchdog-sdk
# or
uv add watchdog-sdk
import watchdog_sdk as watchdog

watchdog.init(
    dsn="https://<key>@your-watchdog-host/<project-id>",
    release="1.0.0",
    environment="production",
)

Call init once, as early as possible. If the DSN is missing or invalid, the SDK logs a warning and stays off. It never raises.

What is captured

  • Unhandled exceptions, including in threads, with the failing line of code and the lines around it. Local variables are never sent.
  • Errors you log with logging (logger.error(...), logger.exception(...)), plus lower-level logs as breadcrumbs.
  • Exceptions you report yourself with watchdog.capture_exception(error).
  • Asyncio errors that nobody awaited, after watchdog.install_asyncio_handler().

Tracing and metrics

with watchdog.start_transaction("handle_call", op="job") as transaction:
    transaction.set_tag("org", "acme")
    with watchdog.span("db", "load agent config"):
        ...

@watchdog.trace(op="task")
async def transcribe(audio): ...

watchdog.increment("calls.completed")
watchdog.gauge("calls.active", 3)
watchdog.distribution("call.duration", 184.2, unit="s")

Transactions you do not sample cost almost nothing: the with blocks become no-ops.

Options

Option Default Meaning
release, environment none Group and filter events
sample_rate 1.0 Share of errors to send
traces_sample_rate 1.0 Share of transactions to send. Use a lower value on busy workers
max_events_per_minute 60 Hard cap on errors sent per minute
max_transactions_per_minute 300 Hard cap on transactions sent per minute
ignore_errors none Messages (text or regex) or exception classes to skip
before_send none Edit an event, or return None to drop it
uncaught_exceptions True Hook sys.excepthook and threading.excepthook
logging_integration_enabled True Report logged errors and keep breadcrumbs
debug False Log why events are dropped

Documentation: https://yassinos-coder.github.io/watchdog/python

Metadata

Release files for watchdog-sdk 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for watchdog-sdk 0.7.0
File Size Uploaded Provenance Actions
watchdog_sdk-0.7.0.tar.gz 16.8 kB With provenance Details for watchdog_sdk-0.7.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for watchdog-sdk 0.7.0
File Interpreter ABI Platform Actions
watchdog_sdk-0.7.0-py3-none-any.whl Python 3 none any Details for watchdog_sdk-0.7.0-py3-none-any.whl

Total release size: 33.8 kB

Release files / watchdog_sdk-0.7.0.tar.gz

Download URL watchdog_sdk-0.7.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a2382f12b2bb83f8de967c40352395e8fcbb4376817c83b46ec02f9a8cb1bf0f
BLAKE2b-256 checksum
How to use checksums
28eddc9967cc0fa417936522894a7f6c9795090bacc051a6a1dd1791f2a4da38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / watchdog_sdk-0.7.0-py3-none-any.whl

Download URL watchdog_sdk-0.7.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
633a0339f6bbbf1195cd2831fc2f781db5ff42f8d4874ec35e09ffb90cd2e607
BLAKE2b-256 checksum
How to use checksums
8e26626ad4d7f4c34f418f1bb64c26736aedc39aff1f1591438a45dbea2b1699
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for watchdog-sdk 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for watchdog_sdk-0.7.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page