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

Initialize in wsgi.py (or asgi.py) before get_wsgi_application():

import os
import insider
from insider.integrations.django import DjangoIntegration

insider.init(
    dsn=os.environ.get("INSIDER_DSN"),
    environment="production",
    release="1.2.3",
    integrations=[DjangoIntegration()],
)

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

That's the whole setup. Every unhandled exception in a view — including Django REST Framework API views — is now a Beacon in your dashboard. No middleware, no INSTALLED_APPS, and no EXCEPTION_HANDLER wiring.

Legacy setup (still supported): add insider.contrib.django to INSTALLED_APPS and InsiderMiddleware to MIDDLEWARE. Prefer the wsgi.py pattern for new projects.

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.3.tar.gz (30.1 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.3-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: insider_python-0.1.3.tar.gz
  • Upload date:
  • Size: 30.1 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.3.tar.gz
Algorithm Hash digest
SHA256 0d60714abb58e01b0948ba08099040ae7955ec74fa297db924aebb9c4fa53f08
MD5 912570af54302a8f405a5e87828c7937
BLAKE2b-256 27ef5fe2aeaedb4d34f100447fa53f57b0825b001bb8e5c82cc0a99cce81be68

See more details on using hashes here.

File details

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

File metadata

  • Download URL: insider_python-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 28.5 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ec75263d49ab26831bfb78c8b278ff4d6555ee25ed469aa5904c4eaa96b696fc
MD5 8949fab1e547f2fe27af39baca84aa4b
BLAKE2b-256 d94a0c9a7f112e01b415c09b15bd88059a611a965a55774d3dc3f9b2fca0c3e6

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