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.

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.4.0.tar.gz (29.8 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.4.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: z4j_flask-1.4.0.tar.gz
  • Upload date:
  • Size: 29.8 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.4.0.tar.gz
Algorithm Hash digest
SHA256 8cabb4d3d79ce18de3e6c7ed45a5f489c40da1e7d346dc720584b8e7cfb4becd
MD5 2c6a20e966c23a6c9c81b6f536f936d3
BLAKE2b-256 626cf1861e3eb7af1ab3e8b696d498002451156cca628cb1100eadc0cbe82eb5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: z4j_flask-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 23.8 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3de56b3487cf2f01dfcd574fe4ede96847243cf0b5e56382236ee853421400fb
MD5 212705d1b5bf20d1a98bb1f98a305fd3
BLAKE2b-256 f90b402c7d257a483b197ca72f3ce5950fc8851ad75ba18582fd52a2587a7f9b

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