Skip to main content

Application error tracking SDK for the Watchdock platform

Project description

watchdock-errors

Python SDK for application-level error tracking on the Watchdock platform.

Installation

pip install watchdock-errors

With framework extras:

pip install "watchdock-errors[django]"
pip install "watchdock-errors[fastapi]"

Quickstart

import watchdock_errors

watchdock_errors.init(
    api_key="wdk_xxx",
    environment="production",
    release="1.0.0",
)

Django

# settings.py
MIDDLEWARE = [
    ...
    "watchdock_errors.integrations.django.DjangoErrorMiddleware",
]

Or via INSTALLED_APPS for automatic registration:

INSTALLED_APPS = [
    ...
    "watchdock_errors.integrations.django",
]

FastAPI

from watchdock_errors.integrations.fastapi import setup_watchdock

setup_watchdock(app)

Manual capture

# Capture the current exception
try:
    process_payment()
except Exception:
    watchdock_errors.capture_exception()

# Capture a specific exception
watchdock_errors.capture_exception(exc)

# Capture a message
watchdock_errors.capture_message("Stripe webhook signature invalid")

PII scrubbing

By default, Authorization, Cookie, and X-Api-Key headers are stripped and the request body is not sent. Set send_pii=True to disable scrubbing.

Use the before_send hook for custom scrubbing:

def scrub(event):
    event["request"]["headers"].pop("X-Internal-Token", None)
    return event  # return None to drop the event entirely

watchdock_errors.init(api_key="wdk_xxx", before_send=scrub)

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

watchdock_errors-0.2.1.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

watchdock_errors-0.2.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file watchdock_errors-0.2.1.tar.gz.

File metadata

  • Download URL: watchdock_errors-0.2.1.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for watchdock_errors-0.2.1.tar.gz
Algorithm Hash digest
SHA256 65710101b9a40c57a0e8d970a45f0a08ed0ffa8ec1ccda87bab235e10e45de69
MD5 bb6a71031ccedbfaf12eacc4c1536681
BLAKE2b-256 75380c34037ac4ebe82d9ff82549002201203c795d3226970ddb23b16b762fd6

See more details on using hashes here.

File details

Details for the file watchdock_errors-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for watchdock_errors-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c97b5b54bc1df56cdd437f1396f2bbf1df78af5338eb11fa04f292fb5dc3cda9
MD5 e1d4f9513a553ea383a0425b5a699c67
BLAKE2b-256 30f6f3da73b5a44504cd318a69d4cb985648dc8d85b59e9e6f5b1b81cd6e3312

See more details on using hashes here.

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