Skip to main content

Bugle SDK

bugle-sdk is lightweight WSGI middleware that reports completed application requests to a Bugle server. It works with Flask, Django, and other WSGI applications. Reporting runs asynchronously and is best-effort, so a reporting failure does not change the application's response.

Install

pip install bugle-sdk

Usage

Wrap your WSGI application once during startup. For Flask:

from flask import Flask
from bugle_sdk import BugleMiddleware

app = Flask(__name__)
app.wsgi_app = BugleMiddleware(app.wsgi_app)

For Django, wrap the WSGI application in your WSGI entry point (commonly config/wsgi.py):

from django.core.wsgi import get_wsgi_application
from bugle_sdk import BugleMiddleware

application = get_wsgi_application()
application = BugleMiddleware(application)

Configuration

On Fly.io, the SDK obtains a short-lived machine identity token automatically. The app, machine, and organization are identified from that token.

For local testing or other non-Fly environments, configure the Bugle server URL, the app name registered in Bugle, and the ingestion key using environment variables:

export BUGLE_URL="http://localhost:8000"
export BUGLE_APP="my-app"
export BUGLE_INGESTION_KEY="your-local-ingestion-key"

BUGLE_URL is optional on Fly and defaults to the SDK's configured Bugle URL. BUGLE_APP defaults to FLY_APP_NAME. BUGLE_INGESTION_KEY is intended only as a shared-secret fallback outside Fly; keep it secret. Without Fly identity or this key, the SDK does not send reports.

For direct configuration, BugleMiddleware also accepts bugle_url, app_name, machine, and ingestion_key keyword arguments.

Reported data

For each completed request, the SDK sends the app name, machine ID, HTTP method, URL path, response status code, and duration in milliseconds to the Bugle /api/hit endpoint. It does not include request or response bodies.

Metadata

Release files for bugle-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bugle-sdk 0.1.1
File Size Uploaded Provenance Actions
bugle_sdk-0.1.1.tar.gz 3.9 kB Without provenance Details for bugle_sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bugle-sdk 0.1.1
File Interpreter ABI Platform Actions
bugle_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for bugle_sdk-0.1.1-py3-none-any.whl

Total release size: 8.0 kB

Release files / bugle_sdk-0.1.1.tar.gz

Download URL bugle_sdk-0.1.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9c512afc600c50da80a7a1daf2a84e54b2e7240da8658346dfc904bc4c604209
BLAKE2b-256 checksum
How to use checksums
226e498bc0ed6bfacdad3a5a3764389253f17a32e16db5e0b6f5c613fbdeb41b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Release files / bugle_sdk-0.1.1-py3-none-any.whl

Download URL bugle_sdk-0.1.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee0677d58353547cf98ec4aecafc4d5d78182afece3250d5d9279d83a246d956
BLAKE2b-256 checksum
How to use checksums
d9f36c926d45f4a1ab8d0d816f8af7e962934350dad888fc2644e9e0bc6156e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.0

Security for bugle-sdk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page