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.2

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.2
File Size Uploaded Provenance Actions
watchdog_sdk-0.7.2.tar.gz 16.8 kB With provenance Details for watchdog_sdk-0.7.2.tar.gz

Built distribution (wheel)

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

Total release size: 33.8 kB

Release files / watchdog_sdk-0.7.2.tar.gz

Download URL watchdog_sdk-0.7.2.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
73f22e94f5b7fac9e907d98f7350ec2a57b9da3215d7d33480297b9c9290469d
BLAKE2b-256 checksum
How to use checksums
49451371d0ac6898a8e98397c2ab85d9a846539972a63d2e769b85450a9d5166
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.2-py3-none-any.whl

Download URL watchdog_sdk-0.7.2-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61e391366565b9028722f359ebe06a20107f1b60ca00181bc02b6a448be84b1d
BLAKE2b-256 checksum
How to use checksums
f50e568903b2ea3786bb2a8991949faf53cb7d9685e4391d141b4f4da9fb14ad
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.2

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.2.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