[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=14935921#comment-14935921 ] Georg Henzler commented on SLING-4862: -- Created SLING-5076 > Sling Health Checks Servlet > --- > > Key: SLING-4862 > URL: https://issues.apache.org/jira/browse/SLING-4862 > Project: Sling > Issue Type: Improvement > Components: Health Check >Reporter: Bertrand Delacretaz >Priority: Minor > Fix For: Health Check Core 1.2.4 > > Attachments: SLING-4862-HealthCheckExecutorServlet-v2.patch, > SLING-4862-HealthCheckExecutorServlet.patch > > > A Servlet that can execute health checks would be useful. > It can take as input the tags of the HCs to execute, and output their results > in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14718144#comment-14718144 ] Nicolas Peltier commented on SLING-4862: yep [~henzlerg], looks good, thanks! Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor Fix For: Health Check Core 1.2.4 Attachments: SLING-4862-HealthCheckExecutorServlet-v2.patch, SLING-4862-HealthCheckExecutorServlet.patch A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14694856#comment-14694856 ] Bertrand Delacretaz commented on SLING-4862: Thanks, I have included your improved help texts in revision 1695656 Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor Fix For: Health Check Core 1.2.4 Attachments: SLING-4862-HealthCheckExecutorServlet-v2.patch, SLING-4862-HealthCheckExecutorServlet.patch A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14694800#comment-14694800 ] Georg Henzler commented on SLING-4862: -- [~bdelacretaz] Looks all good to me, I like the minimal text rendering that can be quite useful in shell scripts. Maybe the following two descriptions in the parameter documentation could be improved: - forceInstantExecution: Forces instant execution by executing async checks directly and circumventing the cache (2sec by default) of the health check executor - timeout: Timeout in ms - a timeout status is returned for any check still running after this period (this overrides the default timeout of the health check executor) Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor Fix For: Health Check Core 1.2.4 Attachments: SLING-4862-HealthCheckExecutorServlet-v2.patch, SLING-4862-HealthCheckExecutorServlet.patch A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14693453#comment-14693453 ] Bertrand Delacretaz commented on SLING-4862: Thanks very much for these changes, I have committed your contribution in revision 1695501. I'll do a few more tweaks, will report here when I'm done. Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor Fix For: Health Check Core 1.2.4 Attachments: SLING-4862-HealthCheckExecutorServlet-v2.patch, SLING-4862-HealthCheckExecutorServlet.patch A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14682429#comment-14682429 ] Georg Henzler commented on SLING-4862: -- Thanks for your comments [~bdelacretaz], updated the patch as follows: - Output is encoded using org.apache.commons.lang.StringEscapeUtils (commons lang is already a dependency) - format can be given as extension, but a helper segment has to be given in path: /system/health/result.json or just /system/health/.json. Unfortunately /system/health.json does not work as there has to be at least one slash after the base path that is registered using httpService.registerServlet() - removed modified method - using css class status + status.name() now - changed method service to doGet (you are right, other methods do not make sense) - status mapping can be configured ala httpStatus=CRITICAL:503,HEALTH_CHECK_ERROR:500 - added a unit test for the servlet (this required to add an equals() to HealthCheckExecutionOptions) Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor Attachments: SLING-4862-HealthCheckExecutorServlet.patch A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680231#comment-14680231 ] Georg Henzler commented on SLING-4862: -- [~npeltier] [~bdelacretaz] Created SLING-4941 for the configurable HC and attached another patch. Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor Attachments: SLING-4862-HealthCheckExecutorServlet.patch A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14680373#comment-14680373 ] Bertrand Delacretaz commented on SLING-4862: Thanks [~henzlerg] for your patch! I've quickly reviewed it, a few comments: The HTML output is not escaped AFAICS, you can use the ResponseUtil class from the Sling api bundle for that (and maybe just embed that class if the API itself is not needed). Are you accepting all HTTP methods by purpose? I would think GET and maybe POST would be enough. The usual convention in Sling is to use extensions to select the output format, do you have a specific reason to use a format parameter? The servlet's {{modified}} method is not useful IMO, it just reimplements the default behavior. I think the {{ResultHtmlSerializer.getClassForStatus()}} method can simply return {{hc + status.toString()}}, and change the CSS class names to use uppercase for the status part. For the HTTP status selection I would prefer a parameter like {{httpStatus=418:WARN}} which means return status 418 if the overall status is = WARN - but I can implement that myself if you want. That's mostly minor things of course, apart from that I think this is a very useful addition to our health checks! Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor Attachments: SLING-4862-HealthCheckExecutorServlet.patch A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14624573#comment-14624573 ] Georg Henzler commented on SLING-4862: -- [~npeltier] for testing purposes, I think an easy dummy HC that can be configured via OSGi to return WARN/CRITICAL is probably the easiest and cleanest solution. Regarding decoupling: our solution provides decoupled renderers for Json and Html, txt could easily be added. Also it is possible to send Http 503 (useful for load balancers) or 200 (default for html response to browser) for WARN/CRITICAL controlled by request Params. I will create a patch once I'm back in the office. Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14618301#comment-14618301 ] Georg Henzler commented on SLING-4862: -- I discussed this with [~jhoh] some time ago - this could be a Sling servlet that takes the tag config from the resource (allowing multiple to have multiple configs as resources at different URLs) or a low-level whiteboard servlet (just using request parameters for tags and response format). The advantage from the latter is performance (no jcr access, it's circumventing sling resource mapping/authentication) and reliability (less dependencies, even if sling was completely broken it can still answer as it relies solely on OSGi). The missing authentication is normally not a problem if a path at under /system is used (e.g /system/health) as those paths are normally hidden from the internet (but I would use configuration policy required for the servlet to only activate if desired). [~bdelacretaz] we have been using a servlet as described above for quite a while already, should we contribute it or would you like to use a different approach? Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14618537#comment-14618537 ] Nicolas Peltier commented on SLING-4862: on the wish list :-) it would be nice to have an osgi flag we can set to make the call fail in all cases (maintenance, ...) not sure if it is better to put it here, or create a dummy health check repeats what you tell him in its conf. Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14618534#comment-14618534 ] Bertrand Delacretaz commented on SLING-4862: What you suggest sounds good and I think both modes (resource-based and last resort path-based) are useful, so if you want to contribute that that would be great. I probably won't be able to work on this for the next 2 weeks but can pick that up when I'm back in action, unless someone beats me to it. Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14618549#comment-14618549 ] Bertrand Delacretaz commented on SLING-4862: [~npeltier] IIUC your use case is to set a flag that marks a Sling instance as being down? Sounds useful, we could add a config flag to the HC servlet. Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (SLING-4862) Sling Health Checks Servlet
[ https://issues.apache.org/jira/browse/SLING-4862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14618564#comment-14618564 ] Nicolas Peltier commented on SLING-4862: [~bdelacretaz] that's it yes, + also configurable OK/NOK messages, and decoupling of the response rendering (txt, html, json might be needed in some cases) Sling Health Checks Servlet --- Key: SLING-4862 URL: https://issues.apache.org/jira/browse/SLING-4862 Project: Sling Issue Type: Improvement Components: Health Check Reporter: Bertrand Delacretaz Priority: Minor A Servlet that can execute health checks would be useful. It can take as input the tags of the HCs to execute, and output their results in JSON format. -- This message was sent by Atlassian JIRA (v6.3.4#6332)