Pulse isn’t in the stores yet. This documentation describes the app as it will ship. Notify me at launch ›

Python

Install pulse-python and add one line to Django, FastAPI, Flask, or a script. Pulse then monitors your dependencies, scheduled jobs, and logs.

From the Free plan, logs on Pro and Team. Python 3.9 or later, with no required dependency.

Install#

zsh
pip install pulse-pythonexport PULSE_KEY=pk_live_…

The key must be in the process environment. Then add the package for your framework. The first report goes out 2 seconds after startup.

settings.py
INSTALLED_APPS = [    "django.contrib.admin",    "pulse_python.django",]

Pulse reads DATABASES, the Redis caches in CACHES and the Celery app. With runserver, only the child process starts the package. Short commands (migrate, shell, test, collectstatic…) don’t start it.

Gunicorn, Uvicorn and Celery#

Each process sends its report, and Pulse keeps the latest one received. With gunicorn --preload, Django and Flask start the package only in the master process, so the workers’ logs aren’t copied. With FastAPI, the lifespan runs in each worker.

A separate Celery worker that loads Django also starts the package, and it’s the one that sees whether jobs succeed or fail. Choose which one sends (PULSE_DISABLED=true in the other), or start the worker with -B and leave the report to it.

What Pulse recognizes#

ObjectWhat Pulse doesName shown
SQLAlchemy Engine and AsyncEngine, Flask-SQLAlchemy, Django connectionsSELECT 1PostgreSQL, MySQL, SQLite…
PyMongo MongoClientpingMongoDB
redis.Redis, redis.asyncio.Redis, Django Redis cachesPINGRedis
Celery appConnects to the broker without publishing anythingFile celery, File emails…
RQ QueueReads the number of jobsFile emails…
Celery beat_scheduleSchedule, next run, successThe job’s name
APScheduler schedulerSchedule, last and next runThe job’s id

Each check has 5 seconds to respond and only reads. A failing dependency, a job that crashed, or one more than 5 minutes past its scheduled run turns the app Degraded.

Your own jobs and checks#

The decorator works on a regular or async function. track wraps a single call. If it fails, the failure is recorded and the error comes back to you unchanged.

jobs.py
from pulse_python import track, track_cron@track_cron("renew-subscriptions")def renew():    subscriptions.renew()track("cleanup", lambda: sessions.clean())

To check a route or anything else, add probes. http_probe makes a GET without following redirects and fails at 500 and above.

main.py
from pulse_python import Probe, http_probe, start_pulsestart_pulse(probes=[    http_probe("Route /health", "http://localhost:8000/health"),    Probe(name="Storage", kind="custom", run=lambda: storage.ping()),])

Choose what is sent#

The heartbeat is always sent. The rest is set by variables, or by options, which take priority over them: the same names in lowercase (log_level, exclude…), in start_pulse, instrument, Pulse or PULSE for Django. An unknown option produces a warning and is ignored.

settings.py
PULSE = {    "exclude": ["File emails"],    "log_level": "WARN",}

Logs#

On Pro and Team, the package adds a handler to the logging root logger, without touching yours. The logger’s name becomes the context, exception traces are kept, and secrets masked.

stderr
ERROR:orbit.payments:Payment declined token=abc123ERROR  orbit.payments  Payment declined token=***

Only messages that reach the root are seen. A logger with propagate = False, like Uvicorn’s access log, stays silent. The package writes its own messages under the pulse_python logger and doesn’t send them.

If nothing arrives#

SymptomWhat to do
PULSE_KEY is missingThe variable isn’t in the process environment: check the service, the container or the .env you load.
Pulse key refusedThe key was replaced in the app: copy the new one, then restart.
Pulse unreachableNetwork or firewall: your app keeps running and sending resumes automatically.
the cryptography package is missingRun pip install "pulse-python[secure]", or remove PULSE_PUBLIC_KEY.
A dependency doesn’t appearWith FastAPI, Flask or a script, pass it in watch.

Still missing an answer? Contact support