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

Add combined health check endpoint which can check multiple components #8191

Merged
merged 6 commits into from
Jun 9, 2023

Conversation

iprentic
Copy link
Contributor

@iprentic iprentic commented Jun 7, 2023

So far, only checks ElasticSearch client, the first one we implemented

Example response on quickstart for URL: http://localhost:8080/health/check/combined

200 response with body

{"elastic":{"headers":{},"body":"{\"cluster_name\":\"docker-cluster\",\"status\":\"yellow\",\"timed_out\":false,\"number_of_nodes\":1,\"number_of_data_nodes\":1,\"active_primary_shards\":65,\"active_shards\":65,\"relocating_shards\":0,\"initializing_shards\":0,\"unassigned_shards\":62,\"delayed_unassigned_shards\":0,\"number_of_pending_tasks\":0,\"number_of_in_flight_fetch\":0,\"task_max_waiting_in_queue_millis\":0,\"active_shards_percent_as_number\":51.181102362204726}","statusCodeValue":200,"statusCode":"OK"}}

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

@github-actions github-actions bot added the devops PR or Issue related to DataHub backend & deployment label Jun 7, 2023
@david-leifker
Copy link
Collaborator

Couple minor comments, once this gets into a release lets be sure update the readiness probe here and make sure it works as expected.

@iprentic
Copy link
Contributor Author

iprentic commented Jun 8, 2023

Example usages:

Base endpoint: http://localhost:8080/health/check/ready
Status code: 200

{"elasticsearch":{"headers":{},"body":"{\"cluster_name\":\"docker-cluster\",\"status\":\"yellow\",\"timed_out\":false,\"number_of_nodes\":1,\"number_of_data_nodes\":1,\"active_primary_shards\":65,\"active_shards\":65,\"relocating_shards\":0,\"initializing_shards\":0,\"unassigned_shards\":62,\"delayed_unassigned_shards\":0,\"number_of_pending_tasks\":0,\"number_of_in_flight_fetch\":0,\"task_max_waiting_in_queue_millis\":0,\"active_shards_percent_as_number\":51.181102362204726}","statusCodeValue":200,"statusCode":"OK"}}

Check Elastic component explicitly: http://localhost:8080/health/check/ready?checks=elasticsearch
Same response as above.

Check non-existent component: http://localhost:8080/health/check/ready?checks=hello
Status code: 500

{"hello":{"headers":{},"body":"Unrecognized component hello","statusCodeValue":500,"statusCode":"INTERNAL_SERVER_ERROR"}}

Check existent and non-existent component: http://localhost:8080/health/check/ready?checks=hello,elasticsearch
Status code: 500

{"elasticsearch":{"headers":{},"body":"{\"cluster_name\":\"docker-cluster\",\"status\":\"yellow\",\"timed_out\":false,\"number_of_nodes\":1,\"number_of_data_nodes\":1,\"active_primary_shards\":65,\"active_shards\":65,\"relocating_shards\":0,\"initializing_shards\":0,\"unassigned_shards\":62,\"delayed_unassigned_shards\":0,\"number_of_pending_tasks\":0,\"number_of_in_flight_fetch\":0,\"task_max_waiting_in_queue_millis\":0,\"active_shards_percent_as_number\":51.181102362204726}","statusCodeValue":200,"statusCode":"OK"},"hello":{"headers":{},"body":"Unrecognized component hello","statusCodeValue":500,"statusCode":"INTERNAL_SERVER_ERROR"}}

@pedro93 pedro93 merged commit 2b94a10 into master Jun 9, 2023
31 checks passed
@pedro93 pedro93 deleted the health branch June 9, 2023 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops PR or Issue related to DataHub backend & deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants