Skip to content

Add support for dag_stats in REST API #40594

Closed

Description

@reganbaum

Description

  1. Today, there is no REST API available to get the stats of a DAG (# success/failed/running/queued runs) via API. However, the UI uses an endpoint dag_stats to display this information. The goal is to have a REST API endpoint available that gets the DAG stats at /api/v1/dag_stats.
  2. Moved over to Add support for dagrun_failed in REST API #40600

Use case/motivation

I would like to programmatically (1) get the stats for all my DAGs and (2) programmatically stop a running workflow, which actually stops the execution (not just changes the state in the database).

Related issues

#40600

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:feature
    needs-triage
    on Jul 3, 2024
  2. added
    area:API
    on Jul 3, 2024
  3. potiuk commented on Jul 3, 2024

    @potiuk
    Member

    (1) - sure if someone implements it
    (2) - impossible until we change architecture (possibly might be doable in Airlfow 3 - I heartily invite you to subscribe to devlist discussions on that and take part in those discussions and advocate and possibly offer contributions to make it happen

  4. potiuk commented on Jul 3, 2024

    @potiuk
    Member

    Marked it for (1) as "good first issue" and if someone would like to implement such endpoint. Also @reganbaum you are welcome to try it if you want to have it faster rather than wait for someone to pick it up and implement.

  5. removed
    needs-triage
    on Jul 3, 2024
  6. reganbaum commented on Jul 4, 2024

    @reganbaum
    Author

    Thanks, Jarek. I moved the dagrun_failed issue (2) over to its own issue for easier tracking: #40600

  7. changed the title [-]Add support for `dag_stats` and `dagrun_failed` in REST API[/-] [+]Add support for `dag_stats` in REST API[/+] on Jul 4, 2024
  8. dondaum commented on Jul 4, 2024

    @dondaum
    Contributor

    Happy to take this over. Would be a good chance to get to know the Airflow REST API.

  9. potiuk commented on Jul 4, 2024

    @potiuk
    Member

    Assigned you

  10. shubham22 commented on Jul 24, 2024

    @shubham22

    @dondaum - are you still working on this? Please let us know if there is anything we can help with. It would be best to have this shipped with v2.10 as the community's focus will be on Airflow 3 afterwards. cc: @ferruzzi

  11. dondaum commented on Jul 24, 2024

    @dondaum
    Contributor

    Yeah I will finish it this week. Sorry I had some busy weeks.

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

Metadata

Metadata

Assignees

Labels

area:APIgood first issuekind:feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions