Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates health check endpoint to include triggerer status #27755

Merged
merged 7 commits into from
Dec 3, 2022

Conversation

daniel-anya
Copy link
Contributor

@daniel-anya daniel-anya commented Nov 17, 2022

This PR updates the health endpoint to include the triggerers status in its response. The status and latest_triggerer_heartbeat sections will be null for deployments that do not include a triggerer component.


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Nov 17, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Nov 17, 2022

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, mypy and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@daniel-anya daniel-anya requested review from potiuk and removed request for ephraimbuddy and mik-laj November 17, 2022 22:05
@potiuk
Copy link
Member

potiuk commented Nov 18, 2022

It also needs updating the docs https://airflow.apache.org/docs/apache-airflow/stable/logging-monitoring/check-health.html

@daniel-anya
Copy link
Contributor Author

It also needs updating the docs https://airflow.apache.org/docs/apache-airflow/stable/logging-monitoring/check-health.html

Thank you! Added here - 6222c58

@potiuk
Copy link
Member

potiuk commented Nov 23, 2022

static checks need fixing though

@daniel-anya
Copy link
Contributor Author

static checks need fixing though

@potiuk Thank you! Should be all fixed now.

@daniel-anya
Copy link
Contributor Author

I'm seeing this new static check error even though I did not make any changes to this file

Run mypy for core......................................................................Failed
- hook id: run-mypy
- exit code: 1

airflow/sensors/base.py:106: error: Name "Iterable" is not defined 
[name-defined]
        valid_modes = ["poke", "reschedule"]  # type: Iterable[str]
        ^
airflow/sensors/base.py:106: note: Did you forget to import it from "typing"? (Suggestion: "from typing import Iterable")
Found 1 error in 1 file (checked 1022 source files)

@potiuk
Copy link
Member

potiuk commented Nov 23, 2022

Seems other PRs have the same - looks like new mypy is more picky

@potiuk
Copy link
Member

potiuk commented Nov 23, 2022

Rebased after merging a fix.

@potiuk potiuk merged commit 144f88b into apache:main Dec 3, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Dec 3, 2022

Awesome work, congrats on your first merged pull request!

@pierrejeambrun pierrejeambrun added this to the Airflow 2.6.0 milestone Jan 9, 2023
@pierrejeambrun pierrejeambrun added the type:improvement Changelog: Improvements label Jan 9, 2023
pankajkoti added a commit to astronomer/airflow that referenced this pull request May 26, 2023
PR apache#27755 introduced sending triggerer
health status in the `/api/v1/health` endpoint and also updated relevant
docs but we've the primary `/health` too which is missing this information.
The PR addresses this missing status report for triggerer health in the
`/health` endpoint. It also attempts to deduplicate the code between those
endpoints so that in future we need to make necessary changes in only one
place and at the same time ensure that change made in one endpoint is not
missed for the other endpoint serving the same purpose and thus ensuring
consistency in the responses.

fixes: apache#31522
jedcunningham pushed a commit that referenced this pull request May 26, 2023
PR #27755 introduced sending triggerer
health status in the `/api/v1/health` endpoint and also updated relevant
docs but we've the primary `/health` too which is missing this information.
The PR addresses this missing status report for triggerer health in the
`/health` endpoint. It also attempts to deduplicate the code between those
endpoints so that in future we need to make necessary changes in only one
place and at the same time ensure that change made in one endpoint is not
missed for the other endpoint serving the same purpose and thus ensuring
consistency in the responses.

fixes: #31522
eladkal pushed a commit that referenced this pull request Jun 8, 2023
PR #27755 introduced sending triggerer
health status in the `/api/v1/health` endpoint and also updated relevant
docs but we've the primary `/health` too which is missing this information.
The PR addresses this missing status report for triggerer health in the
`/health` endpoint. It also attempts to deduplicate the code between those
endpoints so that in future we need to make necessary changes in only one
place and at the same time ensure that change made in one endpoint is not
missed for the other endpoint serving the same purpose and thus ensuring
consistency in the responses.

fixes: #31522
(cherry picked from commit f048aba)
eladkal pushed a commit that referenced this pull request Jun 9, 2023
PR #27755 introduced sending triggerer
health status in the `/api/v1/health` endpoint and also updated relevant
docs but we've the primary `/health` too which is missing this information.
The PR addresses this missing status report for triggerer health in the
`/health` endpoint. It also attempts to deduplicate the code between those
endpoints so that in future we need to make necessary changes in only one
place and at the same time ensure that change made in one endpoint is not
missed for the other endpoint serving the same purpose and thus ensuring
consistency in the responses.

fixes: #31522
(cherry picked from commit f048aba)
ahidalgob pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Nov 7, 2023
PR apache/airflow#27755 introduced sending triggerer
health status in the `/api/v1/health` endpoint and also updated relevant
docs but we've the primary `/health` too which is missing this information.
The PR addresses this missing status report for triggerer health in the
`/health` endpoint. It also attempts to deduplicate the code between those
endpoints so that in future we need to make necessary changes in only one
place and at the same time ensure that change made in one endpoint is not
missed for the other endpoint serving the same purpose and thus ensuring
consistency in the responses.

fixes: #31522
(cherry picked from commit f048aba47e079e0c81417170a5ac582ed00595c4)
GitOrigin-RevId: b6e0c36160afefc9728919af1f9dfc77154b8d1d
ahidalgob pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request May 15, 2024
PR apache/airflow#27755 introduced sending triggerer
health status in the `/api/v1/health` endpoint and also updated relevant
docs but we've the primary `/health` too which is missing this information.
The PR addresses this missing status report for triggerer health in the
`/health` endpoint. It also attempts to deduplicate the code between those
endpoints so that in future we need to make necessary changes in only one
place and at the same time ensure that change made in one endpoint is not
missed for the other endpoint serving the same purpose and thus ensuring
consistency in the responses.

fixes: #31522
GitOrigin-RevId: f048aba47e079e0c81417170a5ac582ed00595c4
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this pull request Sep 19, 2024
PR apache/airflow#27755 introduced sending triggerer
health status in the `/api/v1/health` endpoint and also updated relevant
docs but we've the primary `/health` too which is missing this information.
The PR addresses this missing status report for triggerer health in the
`/health` endpoint. It also attempts to deduplicate the code between those
endpoints so that in future we need to make necessary changes in only one
place and at the same time ensure that change made in one endpoint is not
missed for the other endpoint serving the same purpose and thus ensuring
consistency in the responses.

fixes: #31522
GitOrigin-RevId: f048aba47e079e0c81417170a5ac582ed00595c4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants