Skip to main content

Python SDK for Insider — ship Beacons to your Insider server.

Project description

insider-python

The Python SDK for Insider.

Beam Beacons from your Python service to your Insider server with a one-line setup. No runtime overhead on your request path. Never raises into your code, no matter what.

Install

pip install insider-python

For the Django integration:

pip install "insider-python[django]"

Quick start

Plain Python

import insider

insider.init(
    dsn="https://<beacon_token>@insider.example.com/<project_uuid>",
    environment="production",
    release="1.2.3",
)

try:
    risky()
except Exception as exc:
    insider.capture_exception(exc)

insider.capture_message("cache miss spiked", level="warning")

Django

Add the integration to INSTALLED_APPS and configure via settings:

INSTALLED_APPS = [
    # ...
    "insider.contrib.django",
]

MIDDLEWARE = [
    # ...
    "insider.contrib.django.middleware.InsiderMiddleware",
]

INSIDER_DSN = "https://<beacon_token>@insider.example.com/<project_uuid>"
INSIDER_ENVIRONMENT = "production"
INSIDER_RELEASE = "1.2.3"

That's the whole setup. Every unhandled exception in a view is now a Beacon in your dashboard.

Configuration

Order of precedence (first wins):

  1. Keyword args to insider.init(...).
  2. INSIDER_* environment variables.
  3. Django settings (when the Django integration is active).
  4. Hard-coded defaults.

If no DSN is found anywhere, the SDK enters disabled mode: every public call is a no-op, no thread starts, no socket opens.

Option Default Notes
dsn env INSIDER_DSN If absent, SDK is disabled
environment "production" Top-level Beacon field
release None Top-level Beacon field
send_default_pii False Required to capture user.id, request bodies
before_send None `(beacon) -> beacon
scrub_keys None Extra keys to filter (added to the default deny-list)
in_app_include None Filename prefixes considered "your code"
transport_queue_size 1000 Bounded; drops on overflow
transport_flush_timeout 2.0 Seconds. Used by close() / flush()
debug False Print SDK's own warnings to stderr

Promise

The SDK never raises into your code. Every public function catches Exception at its boundary; if something goes wrong inside the SDK, you get nothing back and a debug log (if enabled). Your app keeps running.

License

MIT

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

insider_python-0.1.2.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

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

insider_python-0.1.2-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file insider_python-0.1.2.tar.gz.

File metadata

  • Download URL: insider_python-0.1.2.tar.gz
  • Upload date:
  • Size: 26.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for insider_python-0.1.2.tar.gz
Algorithm Hash digest
SHA256 186b76a3b74e85fd50ea43519c884c06ef77a30d12b83926e11eb8be9877dfe0
MD5 bb9db582fabfe7ac81cdeb57359782bd
BLAKE2b-256 895e74acfadfe7b1135e53c89b0a7d2354f13997fd844f95282cb5b31b38c26b

See more details on using hashes here.

File details

Details for the file insider_python-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: insider_python-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for insider_python-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 74610607e440598b0f39c8223bca73515dc3d21e40284924301d343894f0b5aa
MD5 8c4ebcf7384af8538e41150935cbded4
BLAKE2b-256 2dd66fabdf4cdda72e1d3f594bf758ad2ef6b179a11b57beb8915152b1c8a9a6

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