event-monitoring
A tiny, non-blocking emitter that publishes business/contextual events from any Python app to a Redis Stream for a monitoring dashboard to consume.
- Sync (
emit) and async (aemit) APIs. - Transaction-safe under Django (
transaction.on_commit); works fine without Django. - Opt-in — a no-op unless
MONITORING_ENABLEDis truthy, so it's inert when installed into an app nobody has wired up to a dashboard. - Only hard dependency is
redis.
Install
pip install event-monitoring
# or
uv add event-monitoring
Pre-release / unpublished, straight from Git:
pip install "git+https://github.com/<you>/event-monitoring.git@v0.1.0"
For local cross-repo dev, as a uv path source:
[tool.uv.sources]
event-monitoring = { path = "../event-monitoring", editable = true }
Usage
import event_monitoring
# Sync (Django views, scripts, workers)
event_monitoring.emit(
event="offer_approved",
entity_type="offer", entity_id=offer.id,
actor_id=request.user.id,
url=request.build_absolute_uri(offer.get_absolute_url()),
payload={"amount": offer.amount},
)
# Async (asyncio apps — e.g. a Discord bot). Offloads the blocking publish.
await event_monitoring.aemit("music_played", entity_type="guild", entity_id=guild_id,
actor_id=user.id, payload={"song": title})
Configuration (env vars)
| Var | Default | Meaning |
|---|---|---|
MONITORING_ENABLED |
0 (off) |
Set 1/true/yes to actually publish. |
MONITORING_APP |
unknown |
Logical source-app name (rms, dryorm, …). |
MONITORING_REDIS_URL |
redis://events-redis:6379/0 |
Redis the dashboard consumes from. Keep separate from the app's own Redis. |
MONITORING_STREAM |
events |
Stream name. |
Publish failures are swallowed (warned once) — monitoring never breaks the host app.
Event shape
{"app":"rms","event":"offer_approved","entity_type":"offer","entity_id":"123",
"actor_id":"55","url":"https://rms.example/offers/123",
"timestamp":"<naive-UTC-iso>","payload":{}}
Metadata
Release files for event-monitoring 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| event_monitoring-0.1.0.tar.gz | 6.0 kB | With provenance | Details for event_monitoring-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| event_monitoring-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for event_monitoring-0.1.0-py3-none-any.whl |
Total release size: 12.1 kB
Release files / event_monitoring-0.1.0.tar.gz
| Download URL | event_monitoring-0.1.0.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4553c69a07e75a3e661589011d9e0adb978cb9fd7ed569a07eab6596790c5b5c
|
|
BLAKE2b-256 checksum How to use checksums |
05705f3b57cbb4aa1912b1e657ead44b3a588f635ad52c02878454c95a65fd64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logRelease files / event_monitoring-0.1.0-py3-none-any.whl
| Download URL | event_monitoring-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ad299e0d4c8a17f0f793242cb8a2a7e136b15a9a66d628c236b9cc9f4d790db7
|
|
BLAKE2b-256 checksum How to use checksums |
04537b6a948d3982cea7c3fc2667b9c421d7261c9857711304433c93e8021845
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logSecurity for event-monitoring 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for event_monitoring-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 12, 2026.
Transparency logA 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.