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 2020/06/13 12:54:48 UTC

[GitHub] [airflow] OmairK opened a new pull request #9277: [WIP] Health endpoint spec

OmairK opened a new pull request #9277:
URL: https://github.com/apache/airflow/pull/9277


   Fixes #8144 
   ---
   Make sure to mark the boxes below before creating PR: [x]
   
   - [ ] Description above provides context of the change
   - [ ] Unit tests coverage for changes (not needed for documentation changes)
   - [ ] Target Github ISSUE in description if exists
   - [ ] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [ ] Relevant documentation is updated including usage instructions.
   - [ ] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on pull request #9277: Health endpoint spec and implementation

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#issuecomment-654406104


   Hiello. 
   We have updated FAB to v3, so we use marshmallow v3. Can you rebase on the latest master?
   Thanks!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440938264



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1382,6 +1403,18 @@ components:
           items:
             $ref: '#/components/schemas/Pool'
 
+    Scheduler:
+      type: object
+      description: Returns the status and the latest scheduler heartbeat 
+      properties:
+        status:
+          type: string

Review comment:
       What values are allowed here? Is it enum?

##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1353,6 +1366,14 @@ components:
           type: array
           items:
             $ref: '#/components/schemas/ImportError'
+    
+    Metadatabase:
+      type: object
+      description: Returns the status of the metadatabase
+      properties:
+        statuses:
+          type: string

Review comment:
       What values are allowed here? Is it enum?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] turbaszek commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r448907827



##########
File path: airflow/api_connexion/endpoints/health_endpoint.py
##########
@@ -14,13 +14,34 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: https://github.com/apache/airflow/issues/8144
+from airflow.api_connexion.schemas.health_schema import health_schema
+from airflow.configuration import conf
+from airflow.jobs.scheduler_job import SchedulerJob
+from airflow.utils.session import provide_session
 
 
 def get_health():
     """
-    Checks if the API works
+    Return the health of the airflow scheduler and metadatabase
     """
-    return "OK"
+    payload = {
+        'metadatabase': {'status': 'unhealthy'}
+    }
+
+    latest_scheduler_heartbeat = None
+    scheduler_status = 'unhealthy'
+    payload['metadatabase'] = {'status': 'healthy'}

Review comment:
       Let's use constants:
   ```
   UNHEALTHY = "unhealthy"
   HEALTHY = "healthy"
   ```
   as we use those values in many places




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] turbaszek commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r448975124



##########
File path: airflow/api_connexion/endpoints/health_endpoint.py
##########
@@ -14,13 +14,35 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: https://github.com/apache/airflow/issues/8144
+from airflow.api_connexion.schemas.health_schema import health_schema
+from airflow.jobs.scheduler_job import SchedulerJob
 
 
 def get_health():
     """
-    Checks if the API works
+    Return the health of the airflow scheduler and metadatabase
     """
-    return "OK"
+    HEALTHY = "healthy"  # pylint: disable=invalid-name
+    UNHEALTHY = "unhealthy"  # pylint: disable=invalid-name

Review comment:
       If you will move those out of the function then there will be no need to disable pylint :)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on pull request #9277: Health endpoint spec and implementation

Posted by GitBox <gi...@apache.org>.
OmairK commented on pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#issuecomment-654492386


   > Hiello.
   > We have updated FAB to v3, so we use marshmallow v3. Can you rebase on the latest master?
   > Thanks!
   
   Rebased and pushed :grinning: 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#issuecomment-643621161


   I have followed [check-health.rst](https://github.com/apache/airflow/blob/e405be0141a996c5bb3659e3f19cab0e1ac8dc8d/docs/howto/check-health.rst) while writing the API spec for heath endpoint for now, but I stumbled upon this [rfc-draft](https://tools.ietf.org/html/draft-inadarei-api-health-check-04) which talks about returning the status of host server (for eg. cpu and memory utilisation) as well as different components being used under the hood. So if this seems helpful in Airflow's case, then I could start by adding status of host server to the API spec. 
   Preview:
   Redoc: https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/OmairK/airflow/healt-endpoint-8144/airflow/api_connexion/openapi/v1.yaml#tag/Monitoring


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] turbaszek commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r448907827



##########
File path: airflow/api_connexion/endpoints/health_endpoint.py
##########
@@ -14,13 +14,34 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: https://github.com/apache/airflow/issues/8144
+from airflow.api_connexion.schemas.health_schema import health_schema
+from airflow.configuration import conf
+from airflow.jobs.scheduler_job import SchedulerJob
+from airflow.utils.session import provide_session
 
 
 def get_health():
     """
-    Checks if the API works
+    Return the health of the airflow scheduler and metadatabase
     """
-    return "OK"
+    payload = {
+        'metadatabase': {'status': 'unhealthy'}
+    }
+
+    latest_scheduler_heartbeat = None
+    scheduler_status = 'unhealthy'
+    payload['metadatabase'] = {'status': 'healthy'}

Review comment:
       Let's use constants:
   ```
   UNHEALTHY = "unhealthy"
   HEALTHY = "healthy"
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440938839



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1353,6 +1366,14 @@ components:
           type: array
           items:
             $ref: '#/components/schemas/ImportError'
+    
+    Metadatabase:

Review comment:
       ```suggestion
       MetadatabaseInfo:
   ```
   or
   ```suggestion
       MetadatabaseStatus:
   ```
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440983374



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1353,6 +1366,14 @@ components:
           type: array
           items:
             $ref: '#/components/schemas/ImportError'
+    
+    Metadatabase:

Review comment:
       Here is the change `b3ec805`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] turbaszek merged pull request #9277: Health endpoint spec and implementation

Posted by GitBox <gi...@apache.org>.
turbaszek merged pull request #9277:
URL: https://github.com/apache/airflow/pull/9277


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440939260



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1382,6 +1403,18 @@ components:
           items:
             $ref: '#/components/schemas/Pool'
 
+    Scheduler:

Review comment:
       ```suggestion
       SchedulerInfo:
   ```
   ```suggestion
       SchedulerStatus:
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r448972246



##########
File path: airflow/api_connexion/endpoints/health_endpoint.py
##########
@@ -14,13 +14,34 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: https://github.com/apache/airflow/issues/8144
+from airflow.api_connexion.schemas.health_schema import health_schema
+from airflow.configuration import conf
+from airflow.jobs.scheduler_job import SchedulerJob
+from airflow.utils.session import provide_session
 
 
 def get_health():
     """
-    Checks if the API works
+    Return the health of the airflow scheduler and metadatabase
     """
-    return "OK"
+    payload = {
+        'metadatabase': {'status': 'unhealthy'}
+    }
+
+    latest_scheduler_heartbeat = None
+    scheduler_status = 'unhealthy'
+    payload['metadatabase'] = {'status': 'healthy'}

Review comment:
       Thanks, fixed it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#issuecomment-651619691


   > Do I have to do anything here? How can I help this change to be finished?
   
   Thanks, I will finish this by today and submit it for review.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440936949



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1128,11 +1128,16 @@ paths:
       tags: [Monitoring]

Review comment:
       Can you also update summary on line 1126?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] turbaszek commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
turbaszek commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r448911785



##########
File path: airflow/api_connexion/endpoints/health_endpoint.py
##########
@@ -14,13 +14,34 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: https://github.com/apache/airflow/issues/8144
+from airflow.api_connexion.schemas.health_schema import health_schema
+from airflow.configuration import conf
+from airflow.jobs.scheduler_job import SchedulerJob
+from airflow.utils.session import provide_session
 
 
 def get_health():
     """
-    Checks if the API works
+    Return the health of the airflow scheduler and metadatabase
     """
-    return "OK"
+    payload = {
+        'metadatabase': {'status': 'unhealthy'}
+    }
+
+    latest_scheduler_heartbeat = None
+    scheduler_status = 'unhealthy'
+    payload['metadatabase'] = {'status': 'healthy'}

Review comment:
       ```python
   latest_scheduler_heartbeat = None
   scheduler_status = 'unhealthy'
   metadatabase_status = 'healthy'
    ...  # here update the statuses
   payload = {
       'metadatabase': {'status': metadatabase_status},
       'scheduler': {
           'status': scheduler_status,
           'latest_scheduler_heartbeat': latest_scheduler_heartbeat,
       }
   }
   return health_schema.dump(payload)
   ```
   What do you think about this approach?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440983840



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1353,6 +1366,14 @@ components:
           type: array
           items:
             $ref: '#/components/schemas/ImportError'
+    
+    Metadatabase:
+      type: object
+      description: Returns the status of the metadatabase
+      properties:
+        statuses:
+          type: string

Review comment:
       Here is the change `b3ec805`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#issuecomment-651559532


   Do I have to do anything here? How can I help this change to be finished?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r448971809



##########
File path: airflow/api_connexion/endpoints/health_endpoint.py
##########
@@ -14,13 +14,34 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-
-# TODO(mik-laj): We have to implement it.
-#     Do you want to help? Please look at: https://github.com/apache/airflow/issues/8144
+from airflow.api_connexion.schemas.health_schema import health_schema
+from airflow.configuration import conf
+from airflow.jobs.scheduler_job import SchedulerJob
+from airflow.utils.session import provide_session
 
 
 def get_health():
     """
-    Checks if the API works
+    Return the health of the airflow scheduler and metadatabase
     """
-    return "OK"
+    payload = {
+        'metadatabase': {'status': 'unhealthy'}
+    }
+
+    latest_scheduler_heartbeat = None
+    scheduler_status = 'unhealthy'
+    payload['metadatabase'] = {'status': 'healthy'}

Review comment:
       Thanks. [Fixed it](https://github.com/apache/airflow/pull/9277/files#diff-d7bb321505e9703c67dc7c78ff5b55deR25-R48) 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440937656



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1353,6 +1366,14 @@ components:
           type: array
           items:
             $ref: '#/components/schemas/ImportError'
+    
+    Metadatabase:
+      type: object
+      description: Returns the status of the metadatabase
+      properties:
+        statuses:
+          type: string

Review comment:
       Is there a reason why we have statuses in one place and status in another?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r443195547



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1123,16 +1123,21 @@ paths:
 
   /health:
     get:
-      summary: Checks if the API works
+      summary: Returns the status of Airflow's metadatabase and scheduler.
       operationId: airflow.api_connexion.endpoints.health_endpoint.get_health
       tags: [Monitoring]
       responses:
         '200':
-          description: It should always return "OK"
+          description: Returns info about metadatabase and last heart beat.
           content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HealthInfo'
             text/plain:
               schema:
                 type: string
+        '401':
+          $ref: '#/components/responses/Unauthenticated'

Review comment:
       This should be publicly available so that other services can easily use it
   ```suggestion
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r443220892



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1123,16 +1123,21 @@ paths:
 
   /health:
     get:
-      summary: Checks if the API works
+      summary: Returns the status of Airflow's metadatabase and scheduler.
       operationId: airflow.api_connexion.endpoints.health_endpoint.get_health
       tags: [Monitoring]
       responses:
         '200':
-          description: It should always return "OK"
+          description: Returns info about metadatabase and last heart beat.
           content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HealthInfo'
             text/plain:
               schema:
                 type: string
+        '401':
+          $ref: '#/components/responses/Unauthenticated'

Review comment:
       Here is the change `5a215c8 `




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440982968



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1353,6 +1366,14 @@ components:
           type: array
           items:
             $ref: '#/components/schemas/ImportError'
+    
+    Metadatabase:
+      type: object
+      description: Returns the status of the metadatabase
+      properties:
+        statuses:
+          type: string

Review comment:
       Here is the change `b3ec805`
   
   For now I have used these enums for status:
   - `healthy` 
   - `unhealthy` 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440934523



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1328,6 +1333,14 @@ components:
           type: array
           items:
             $ref: '#/components/schemas/EventLog'
+    
+    Health:

Review comment:
       ```suggestion
       HealthInfo:
   ```
   We have VersionInfo already. This will allow us to maintain consistency in names.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r443195619



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1123,16 +1123,21 @@ paths:
 
   /health:
     get:
-      summary: Checks if the API works
+      summary: Returns the status of Airflow's metadatabase and scheduler.
       operationId: airflow.api_connexion.endpoints.health_endpoint.get_health
       tags: [Monitoring]
       responses:
         '200':
-          description: It should always return "OK"
+          description: Returns info about metadatabase and last heart beat.
           content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HealthInfo'
             text/plain:
               schema:
                 type: string

Review comment:
       ```suggestion
   ```
   Rather, we will not be able to fit all the data in a text response.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r440983138



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1382,6 +1403,18 @@ components:
           items:
             $ref: '#/components/schemas/Pool'
 
+    Scheduler:

Review comment:
       Here is the change `b3ec805`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] OmairK commented on a change in pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
OmairK commented on a change in pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#discussion_r443220852



##########
File path: airflow/api_connexion/openapi/v1.yaml
##########
@@ -1123,16 +1123,21 @@ paths:
 
   /health:
     get:
-      summary: Checks if the API works
+      summary: Returns the status of Airflow's metadatabase and scheduler.
       operationId: airflow.api_connexion.endpoints.health_endpoint.get_health
       tags: [Monitoring]
       responses:
         '200':
-          description: It should always return "OK"
+          description: Returns info about metadatabase and last heart beat.
           content:
+            application/json:
+              schema:
+                $ref: '#/components/schemas/HealthInfo'
             text/plain:
               schema:
                 type: string

Review comment:
       Thanks here is the change `5a215c8 `




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [airflow] mik-laj commented on pull request #9277: [WIP] Health endpoint spec

Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #9277:
URL: https://github.com/apache/airflow/pull/9277#issuecomment-652839628


   @turbaszek Can you look at it?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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