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

Adding /admin GET method which will return GOOD to denote the health of Azkaban web server #3053

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jakhani
Copy link
Contributor

@jakhani jakhani commented Feb 23, 2022

/admin call will return GOOD. It can be used to integrate with health and monitoring system for web server.

@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #3053 (3f608bb) into master (9805fb3) will increase coverage by 0.03%.
The diff coverage is 42.85%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3053      +/-   ##
============================================
+ Coverage     41.49%   41.53%   +0.03%     
- Complexity     4654     4655       +1     
============================================
  Files           596      597       +1     
  Lines         40037    40051      +14     
  Branches       4654     4654              
============================================
+ Hits          16614    16634      +20     
+ Misses        22049    22039      -10     
- Partials       1374     1378       +4     
Impacted Files Coverage Δ
az-core/src/main/java/azkaban/Constants.java 21.42% <ø> (ø)
...main/java/azkaban/webapp/servlet/AdminServlet.java 33.33% <33.33%> (ø)
...rver/src/main/java/azkaban/execapp/FlowRunner.java 71.88% <100.00%> (+0.02%) ⬆️
...src/main/java/azkaban/webapp/AzkabanWebServer.java 26.31% <100.00%> (+0.22%) ⬆️
...n-common/src/main/java/azkaban/user/UserUtils.java 64.51% <0.00%> (-3.23%) ⬇️
...mon/src/main/java/azkaban/user/XmlUserManager.java 58.53% <0.00%> (-1.22%) ⬇️
...azkaban/execapp/event/JobCallbackRequestMaker.java 70.83% <0.00%> (+18.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2f0e19e...3f608bb. Read the comment docs.

Copy link
Contributor

@svnarumugam svnarumugam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes look good. I am wondering

  1. why don't we use /status itself to solve the same problem?
  2. can we consider returning a JSON response? The clients who are using can parse this easily and if we choose to add more fields in the response it will be convenient.

@jakhani
Copy link
Contributor Author

jakhani commented Feb 24, 2022

@svnarumugam , we have been using /status but it is not just for health check. It queries lot of things from database and sometimes slow when it comes to pinging /status for every hit coming to Azkaban web server. We need light API.
Reason why we are not returning json is for internal LinkedIn integration for any services' status, they expect response this way (plain GOOD).

@amielkelinkedin
Copy link
Contributor

amielkelinkedin commented Feb 24, 2022

@jakhani Can we change the name of this endpoint? /health? /monitor? /ping? /heartbeat?

Comment on lines +49 to +58
try {
resp.setContentType(JSON_MIME_TYPE);
resp.getOutputStream().println("GOOD");
resp.setStatus(HttpServletResponse.SC_OK);
} catch (final Exception e) {
logger.error("Error!! while reporting status: ", e);
resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
} finally {
resp.getOutputStream().close();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use the sendResponse method defined in the AbstractAzkabanServlet class?

@ypadron-in
Copy link
Collaborator

ypadron-in commented Feb 24, 2022

Could you please add an example response in the PR description?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants