Django integration for capturing LogBrew request spans and exceptions.
Project description
logbrew-django
Django integration for capturing LogBrew request spans and exceptions with the public Python SDK.
Install
python3 -m pip install logbrew-sdk logbrew-django
The package is typed, ships py.typed, depends on the core logbrew-sdk, and keeps Django as a normal framework dependency instead of owning the user's project layout.
Example
# settings.py
MIDDLEWARE = [
"logbrew_django.LogBrewDjangoMiddleware",
*MIDDLEWARE,
]
# app startup code
from logbrew_django import configure_logbrew
from logbrew_sdk import LogBrewClient, RecordingTransport
client = LogBrewClient.create(
api_key="LOGBREW_API_KEY",
sdk_name="logbrew-django",
sdk_version="0.1.0",
)
transport = RecordingTransport.always_accept()
configure_logbrew(
client=client,
transport=transport,
span_id_factory=lambda: "b7ad6b7169203331",
)
LogBrewDjangoMiddleware records successful requests as span events, records unhandled view exceptions as issue plus error-span events, and flushes through the configured transport after each response. If no transport is provided, events stay queued on the core client so the project can flush them itself.
When an incoming request has a valid W3C traceparent header, request capture continues that trace by using the incoming traceId and parent span id while creating a fresh child span id. Missing or malformed traceparent headers keep the existing synthetic request span behavior so bad client headers do not break the project. Automatic metadata uses the request path without query text.
By default, transport failures do not break the Django response path. Set raise_flush_errors=True only when your project wants delivery failures to surface as request errors.
Use a clearly fake placeholder like LOGBREW_API_KEY in examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logbrew_django-0.1.1.tar.gz.
File metadata
- Download URL: logbrew_django-0.1.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
626f802728c0278cde36a5c25679adef14af021b1508c4f120f2e09d688bfccc
|
|
| MD5 |
5c7b939e723ca96685993d85a9b9d115
|
|
| BLAKE2b-256 |
3d41830819645dccd4a11caaf062a78afadccdb023217e0e2e1ce7a5f86d0e5c
|
Provenance
The following attestation bundles were made for logbrew_django-0.1.1.tar.gz:
Publisher:
publish-packages.yml on LogBrewCo/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logbrew_django-0.1.1.tar.gz -
Subject digest:
626f802728c0278cde36a5c25679adef14af021b1508c4f120f2e09d688bfccc - Sigstore transparency entry: 1803157885
- Sigstore integration time:
-
Permalink:
LogBrewCo/sdk@2ad6679e80a58ca3e713b9e13be9c315098010fc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LogBrewCo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish-packages.yml@2ad6679e80a58ca3e713b9e13be9c315098010fc -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file logbrew_django-0.1.1-py3-none-any.whl.
File metadata
- Download URL: logbrew_django-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c374e30beafc04899ad8a5bcfcdb6064e93db1c45a0d4270cc743f534cf4ead
|
|
| MD5 |
56149680dc69582dad72d6f7cafd1e7c
|
|
| BLAKE2b-256 |
6d72c8e058ce775abab692e4f6b249de4ce655f4eec7b6d8b8f3944bf603b01d
|
Provenance
The following attestation bundles were made for logbrew_django-0.1.1-py3-none-any.whl:
Publisher:
publish-packages.yml on LogBrewCo/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
logbrew_django-0.1.1-py3-none-any.whl -
Subject digest:
9c374e30beafc04899ad8a5bcfcdb6064e93db1c45a0d4270cc743f534cf4ead - Sigstore transparency entry: 1803157925
- Sigstore integration time:
-
Permalink:
LogBrewCo/sdk@2ad6679e80a58ca3e713b9e13be9c315098010fc -
Branch / Tag:
refs/heads/main - Owner: https://github.com/LogBrewCo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
self-hosted -
Publication workflow:
publish-packages.yml@2ad6679e80a58ca3e713b9e13be9c315098010fc -
Trigger Event:
workflow_dispatch
-
Statement type: