Skip to content

Navigation Menu

Sign in
Sign up

Add a Taskiq bootstrapper #178

Open
Open
Labels
enhancementNew feature or request

Description

Taskiq is the one framework that clears the bar set by the existing five, and it clears it on binding cost rather than on popularity.

Why Taskiq specifically

Its OpenTelemetry and Prometheus middlewares are first-party in the frameworktaskiq/middlewares/opentelemetry_middleware.py and taskiq/middlewares/prometheus_middleware.py, behind the taskiq[opentelemetry] and taskiq[metrics] extras. That is a better position than FastStream, where the user must supply opentelemetry_middleware_cls themselves.

It also ships an [opentelemetry_instrumentor] entry point (taskiq = taskiq.instrumentation:TaskiqInstrumentor), which the existing opentelemetry_instrumentors machinery already consumes.

Both lifecycle hooks are public and post-construction, so there is no ADR-0001-shaped teardown fight:

  • attach: AsyncBroker.add_middlewares(*middlewares)
  • teardown: broker.add_event_handler(TaskiqEvents.WORKER_SHUTDOWN, ...)

Free-threading: taskiq is a pure-Python wheel, and the native packages in its closure (pydantic-core, multidict, yarl, frozenlist, propcache, and psutil for the otel extra) all publish cp313t/cp314t wheels. No repeat of the pyroscope-io / grpcio problem.

The two design calls, to be settled in the PR body

1. Prometheus does not fit the existing config shape. PrometheusMiddleware.__init__ takes server_port: int = 9000 and calls prometheus_client.start_http_server — it self-hosts a WSGI server rather than exposing a path on the application. Every other framework in the matrix mounts at prometheus_metrics_path. Either the metrics cell is omitted for Taskiq, or PrometheusConfig grows a second shape for self-hosting brokers. Omitting is the smaller change and the better default.

2. Only 5 of 8 instruments apply. Taskiq has no ASGI wrapper equivalent to AsgiFastStream, so cors, swagger and health-checks have nothing to bind to. Applicable: logging, sentry, opentelemetry, pyroscope, and prometheus (subject to call 1).

Cost

A new bootstrapper file plus up to 6 extras (taskiq, -sentry, -otl, -logging, -metrics, -all). The extras are the expensive part, not the Python: install-isolation builds a fresh venv per extra and coverage is pinned at 100%. The existing five frameworks cost 3,297 lines under tests/.

Not this issue

Sentry has no first-party Taskiq integration in sentry-python. The generic SentryInstrument still applies; no custom integration is in scope here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /