You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/12/12 14:39:12 UTC

[GitHub] XD-DENG opened a new pull request #4309: [AIRFLOW-3504] Extend/refine the functionality of "/health" endpoint

XD-DENG opened a new pull request #4309: [AIRFLOW-3504] Extend/refine the functionality of "/health" endpoint
URL: https://github.com/apache/incubator-airflow/pull/4309
 
 
   
   ### Jira
   
     - https://issues.apache.org/jira/browse/AIRFLOW-3504
   
   
   ### Description
   
   
   #### The Issue That This PR Tried to Address
   
   For both www/ and www_rbac/, there is "/health" endpoint, which is supposed to help users know the "health" condition of the Airflow application.
   
   But the functionality of it at this moment is very limited. It can only help check if the webserver is running, but actually the "health" of the application may be bad even though this endpoint returns "The server is healthy!" (scheduler may be down, database backend may be disconnected, etc)
   
   #### What Have Been Done in This PR
   
   Extend the functionality of "`/health`" endpoint:
   1. Check if webserver is up;
   2. Check if database backend can be connected;
   3. Check the latest scheduler run
   
   This is done for both `/www` and `/www_rbac`. Tests are added accordingly as well.
   
   Note that no authentication is required to access "`/health`" endpoint (no sensitive information will be exposed through it).
   
   (Deleted an unnecessary line in `airflow/www/views.py` as well)
   
   #### How Final Result Looks Like
   
   The "`/health`" endpoint will return a JSON like
   
   ```
   {  
      'webserver':'The server is healthy!',
      'database':'available',
      'scheduler':{  
         'latest_scheduler_run':'2018-12-26 17:15:11+00:00'
      }
   }
   ```
   
   ### Tests
   
   - [x] My PR adds the following unit tests __OR__ does not need testing for this extremely good reason:
   
   
   ### Code Quality
   
   - [x] Passes `flake8`
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services