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.1.tar.gz (26.7 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.1-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: insider_python-0.1.1.tar.gz
  • Upload date:
  • Size: 26.7 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.1.tar.gz
Algorithm Hash digest
SHA256 2b33a8e2d36848d5febe80eb301cd0d18725c1f4993a4aecd5be5fa6bedb13e1
MD5 3e594d9fc37ec5f682f34dc9a0fe87b9
BLAKE2b-256 f6ff570a6f898ad344f67d6a87a78f28a6eaa4cec9f87c422fa4dc4d2b0e8ce7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: insider_python-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 09c7773b87d8d23bc597b750f05852fd6b764e2c29e4ca2eb361908b353699a8
MD5 7ba8b628a650d1fd2089c67bf617dcf3
BLAKE2b-256 4a8626757eb96b97c1e4b6d3a6ca7d3c1d75919ded6b1eb6beebb2c01bb3bb8b

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