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.0.tar.gz (26.3 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.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: insider_python-0.1.0.tar.gz
  • Upload date:
  • Size: 26.3 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.0.tar.gz
Algorithm Hash digest
SHA256 65ba7f113339cd93eada8979548d583d1a50694ebaa955f84984afaad94f3739
MD5 4552a6ecc6026188afb60b93718321a6
BLAKE2b-256 69e6e779bd7b922cf0c1025852532715f51f37f3670dd414b1c4782b9e97f760

See more details on using hashes here.

File details

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

File metadata

  • Download URL: insider_python-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a36cb3e8bcf1baf3e08700a8bbf8bd8d7b0bdca9ae7634c60034e8d85e8af590
MD5 7dac40cbbafdf1b7a30581fdccf99d5c
BLAKE2b-256 6027a73f3bf7eb7f0a6f89e548bf12c11c1b35fc835fd85fe593cb33efe21856

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