Skip to content

Add REST API metrics (latency, QPS, errors) #56034

Closed

Description

@rawwar

Description

Currently, Airflow’s REST API does not emit any metrics. It would be valuable to have basic API metrics for observability.

Use case/motivation

  • Track API performance (p95/p99 latency).
  • Monitor usage patterns (QPS per endpoint).
  • Alert on failures (error spikes).

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. KatalKavya96 commented on Sep 24, 2025

    @KatalKavya96
  2. rawwar commented on Sep 24, 2025

    @rawwar
    ContributorAuthor

    @rawwar I would like to work on this issue. Could you please assign it to me?

    I actually created this issue to request comments. At this time, I am not sure if this should be implemented.

  3. added this to the Airflow 3.2.0 milestone on Feb 24, 2026
  4. pierrejeambrun commented on Feb 24, 2026

    @pierrejeambrun
    Member

    This is a very interesting feature to get. Having telemetry for the public/ui API would be great. Eventually we can discuss adding this to the execution_api too.

    We just need to agree on an instrumentation tool that fits well in the airflow ecosystem to get started and it should be pretty straight forward for a basic implementation.

    Jed mentioned https://github.com/trallnag/prometheus-fastapi-instrumentator. There might be other options around.

    We just need to make sure it's not impacting performance too much.

  5. ssbytedev commented on Feb 28, 2026

    @ssbytedev

    Hello, if this issue is not assigned, can I work on it?

  6. pierrejeambrun commented on Mar 5, 2026

    @pierrejeambrun
    Member

    @SruthiSathya Please, feel free to work on it and open a PR, you do not have to be assigned to work on a particular issue. :)

    We recently updated our guidelines and we are not assigning issues anymore as per our policy,

  7. henry3260 commented on Mar 28, 2026

    @henry3260
    Member

    Hi @pierrejeambrun, would it make sense to use Airflow's existing stats/observability framework rather than adding a third-party library here?

    That would keep the API server aligned with the rest of Airflow's metrics approach and avoid introducing a separate path just for API-server metrics. Since the library also notes some performance cost, it seems better to start with the built-in Airflow stats abstraction if possible.

  8. pierrejeambrun commented on Mar 30, 2026

    @pierrejeambrun
    Member

    @henry3260 Yes I think it's a good consideration. Feel free to give it a shot if you'd like I'd be glad to review a PR or a draft in that sense.

  9. henry3260 commented on Aug 28, 2026

    @henry3260
    Member

    Scope note, since the metrics that ship differ from the three listed in the description.

    #64523 emits two metrics for /api/v2 and /ui requests:

    • http_requests_total (counter)
    • http_request_duration_milliseconds (timer)

    both tagged with method, route (the FastAPI route template) and status_family (2xx/4xx/5xx).

    That still covers the three use cases here:

    • latency (p95/p99) — http_request_duration_milliseconds, broken down by route
    • QPS per endpoint — http_requests_total, broken down by route
    • error spikes — http_requests_total filtered on status_family="5xx", rather than
      a dedicated errors metric

    The separate errors counter was dropped on purpose: it would duplicate series that status_family already distinguishes, and keeping the tag set small was the main constraint on this change.

  10. jasperjonkhans commented on Aug 29, 2026

    @jasperjonkhans
    Contributor

    Hey, I would like to give this issue a try! :)

  11. pierrejeambrun commented on Sep 8, 2026

    @pierrejeambrun
    Member

    @jasperjonkhans There is already an open PR for this close to being merged.

    I would suggest to find another issue to work on :)

  12. self-assigned this
    on Sep 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions