Skip to main content

z4j Flask framework adapter (Apache 2.0)

Project description

z4j-flask

PyPI version Python License

The Flask framework adapter for z4j.

Adds the z4j agent into your Flask app via a one-line Z4J(app) initializer. Auto-discovers the engine adapter you have installed (Celery, RQ, Dramatiq, Huey, arq, TaskIQ) and streams every task lifecycle event to z4j. Operator control actions flow back the same channel.

Compatibility

  • Flask 3.1.3+ (no upper cap)
  • Python 3.10+

Pair with an engine adapter (z4j-celery, z4j-rq, z4j-dramatiq, z4j-huey, z4j-arq, z4j-taskiq); each engine adapter carries its own upstream floor.

Full per-adapter matrix at https://z4j.dev/reference/compatibility/.

What it ships

  • One-line install, Z4J(app) and the agent connects on the next worker boot
  • Engine auto-discovery, picks up whichever z4j engine adapter is installed alongside; cross-stack combos (Flask + RQ, Flask + Celery) are first-class
  • @z4j_meta decorator, optional per-task annotations (priority="critical", description="...") for dashboard filtering and SLO display
  • Service-user safe, auto-relocates the local outbound buffer to $TMPDIR/z4j-{uid} when $HOME is unwritable

Install

pip install z4j-flask z4j-celery z4j-celerybeat

Wire it into your app:

from flask import Flask
from z4j_flask import Z4J

app = Flask(__name__)
Z4J(app)  # reads Z4J_AGENT_TOKEN, Z4J_BRAIN_URL, Z4J_PROJECT from env

Mint the agent token from the dashboard's Agents page.

Reliability

  • No exception from the agent ever propagates back into Flask request handlers or your worker code.
  • Events buffer locally when z4j is unreachable; your application never blocks on network I/O.

Documentation

Full docs at z4j.dev/frameworks/flask/.

License

Apache-2.0, see LICENSE.

Links

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

z4j_flask-1.6.9.tar.gz (28.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

z4j_flask-1.6.9-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file z4j_flask-1.6.9.tar.gz.

File metadata

  • Download URL: z4j_flask-1.6.9.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for z4j_flask-1.6.9.tar.gz
Algorithm Hash digest
SHA256 930877715c19a6b2755082bba33f184d9c95d239a55112eb36ad142de200d2cb
MD5 f04c93f95baa19e7587ffd25dbce1ed3
BLAKE2b-256 9beff2010955ad2d58aa240b66ce77fc2a6bdb3d88100fdb762574f1e9fe9517

See more details on using hashes here.

File details

Details for the file z4j_flask-1.6.9-py3-none-any.whl.

File metadata

  • Download URL: z4j_flask-1.6.9-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for z4j_flask-1.6.9-py3-none-any.whl
Algorithm Hash digest
SHA256 8fdb5566846ac52e42e049c4bb5826f059b0738eab560508c83c3451908dd5ad
MD5 3dbf1ad082e0f04cbde8c6b04b54c211
BLAKE2b-256 90d6fff3d3b919878fbe86a74addc0d9bd9eb15aeb477226542e790b6176446f

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