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

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

Built distribution (wheel)

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

Total release size: 33.8 kB

Release files / watchdog_sdk-0.7.1.tar.gz

Download URL watchdog_sdk-0.7.1.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
af45801e9d7f42cfeff1a4940fd23028d467b13057fbb344ac79e8a0e568dade
BLAKE2b-256 checksum
How to use checksums
a91043fe39e4e611c70ab0401fff68b4b13e0485140518b64e1bc7ad67dd2007
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.1-py3-none-any.whl

Download URL watchdog_sdk-0.7.1-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d30ad9fdcc697d5305a67e7510c6230ddf1e177334b8a13d7a34d2f572593b2
BLAKE2b-256 checksum
How to use checksums
0aaf6fdffb5b0d133e14423e9bb342c1098419f4ca99019c71649ed00d0d18b8
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.1

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