SlideShare a Scribd company logo
1 of 22
Download to read offline
Sling  health  checks      -­‐      Bertrand  Delacretaz
Tamingyour

AEMinstances
withthe

ApacheSling
HealthCheckTools
BertrandDelacrétaz

PrincipalScientist,AdobeCQ/AEMR&Dteam,Basel
ApacheSlingcommitter,ASFMemberand(current)Director

@bdelacretaz-grep.codeconsult.ch
AEMHubLondon,April2014
slidesrevision2014-04–09,atslideshare.net/bdelacretaz
Sling  health  checks      -­‐      Bertrand  Delacretaz
picture: anitapeppers on
morguefile.com
How  can  you  trust  your  
current  (fragile?)  
combina?on  of  OSGi  
bundles  and  configs?  
!
It  needs  live  
TESTING.  
Sling  health  checks      -­‐      Bertrand  Delacretaz
Test  code  in  my  produc?on  instance?
picture: melschmitz on morguefile.com
Sling  health  checks      -­‐      Bertrand  Delacretaz
whatdowemeanby

Health
Checks?
Sling  health  checks      -­‐      Bertrand  Delacretaz
Health  Checks?
public interface HealthCheck {
Result execute();
}
public class Result {
public boolean isOk() ...
public Status getStatus() ...
public Iterator<ResultLog.Entry> iterator() ...
}
HealthCheck

OSGi services
Serviceprops:

name,MBean,tags
Sling  health  checks      -­‐      Bertrand  Delacretaz
Webconsoleand
JMX
Sling  health  checks      -­‐      Bertrand  Delacretaz
Webconsole  /system/console/healthcheck
Sling  health  checks      -­‐      Bertrand  Delacretaz
Health  Check  MBeans  (auto-­‐created)
Serviceprops

:
name,MBean,tags
Sling  health  checks      -­‐      Bertrand  Delacretaz
Health  Checks  as  JMX  Processors
MBean
MBean
MBean
HC
HC
HC
using expressions like

jmx.attribute('java.lang:type=ClassLoading', 'LoadedClassCount') > 10 



&&
jmx.attribute('java.lang:type=Runtime', 'ManagementSpecVersion') > 1
Sling  health  checks      -­‐      Bertrand  Delacretaz
JMX  ResourceProvider
curl
http://localhost:8080/system/sling/monitoring/mbeans/...queriesStatus.tidy.2.json
{
"mbean:objectName": 

“org.apache.sling.healthcheck:name=qs,type=HealthCheck",
"sling:resourceType": "sling:mbean",
"hc.name": "Query Performance",
"mbean:description": "Health check",
"status": "OK",
"log": …
Sling  health  checks      -­‐      Bertrand  Delacretaz
herecomesthe

big(?)






demo!
(webconsole,JMX,configuration)
Sling  health  checks      -­‐      Bertrand  Delacretaz
typicalUseCases
Sling  health  checks      -­‐      Bertrand  Delacretaz
Typical  Use  Cases
System status
Allbundlesup?
Initialcontentready?
Diskspaceok?
Externalservicesok?
Loadwithinbounds?(forjobs)
Performance
Requestspersecondok?
Requestdurationok?
Freememoryok?
Replicationqueuesok?
Configuration
Securitychecklistok?
Defaultaccountsdisabled?
Democontentremoved?
Self-test
Startupsmoketests?
Keephistoryofresults?
ReporttoHTTPfront-end
http://bit.ly/Qjxh93
TalktoJustinEdelson!
Sling  health  checks      -­‐      Bertrand  Delacretaz
Sling  devops  experiments
https://github.com/bdelacretaz/
sling-devops-vol1
Health checks tell the
cluster controller when a
Sling instance is ready to
be injected in the cluster.
Sling  health  checks      -­‐      Bertrand  Delacretaz
whatdoyouget

Outofthebox?
Sling  health  checks      -­‐      Bertrand  Delacretaz
Out  of  the  Box  -­‐  core
JmxAttributeHealthCheck
ScriptableHealthCheck
CompositeHealthCheck
Single JMX attributes
Script(let)s in any language

using BindingValuesProviders

Run other Health Checks
based on their tags
Sling  health  checks      -­‐      Bertrand  Delacretaz
Out  of  the  box  -­‐  support  bundle
SlingRequestStatusHC
DefaultLoginsHealthCheck
Is my resource there?
Including its scripts?
admin:admin -> fail?
current HC bundles:
org.apache.sling.hc.core
org.apache.sling.hc.support
org.apache.sling.hc.webconsole
org.apache.sling.hc.samples
JUnitHealthCheck
And also:
From the junit.healthcheck bundle
Sling  health  checks      -­‐      Bertrand  Delacretaz
howdoyouwrite

YourownHealth
Checks?
Sling  health  checks      -­‐      Bertrand  Delacretaz
BYOHC  -­‐  Bring  Your  Own  HCs  !
@Component(...policy=ConfigurationPolicy.REQUIRE, metatype=true)
@Service(value=HealthCheck.class)
!
@Property(name=HealthCheck.NAME),
@Property(name=HealthCheck.TAGS,unbounded=PropertyUnbounded.ARRAY),
@Property(name=HealthCheck.MBEAN_NAME)
!
public class MyHealthCheck {
public Result execute() {
FormattingResultLog f = new FormattingResultLog();
...
if(badThings) f.warn(“Something happened with {}”, foo);
return new Result(f);
}
}
Sling  health  checks      -­‐      Bertrand  Delacretaz
HealthChecksExecutor
Sling  health  checks      -­‐      Bertrand  Delacretaz
Health  Check  Executor  Service
public interface HealthCheckExecutor {
!
List<HealthCheckExecutionResult>

execute(String... tags);
!
}
ExecutesHCsselectedbytags,withcaching.
Resultincludesexecutionmetadata,timeoutinfoetc.
Sling  health  checks      -­‐      Bertrand  Delacretaz
docs at sling.apache.org : bundles : health check.
discuss on the Apache Sling dev list.
I’m @bdelacretaz - thanks!
JMX processors
Webconsole
JmxAttributeHealthCheck
ScriptableHealthCheck
CompositeHealthCheck
SlingRequestStatusHC
DefaultLoginsHealthCheck
JUnitHealthCheck
That’s  it!  Have  fun.
@Service(HealthCheck.class)

public class MyHealthCheck {
....generate a Result here…
}

More Related Content

Similar to Taming your CQ/AEM instances with the Apache Sling Health Checks

Similar to Taming your CQ/AEM instances with the Apache Sling Health Checks (20)

DevOps - Chaos Engineering on Kubernetes
DevOps - Chaos Engineering on KubernetesDevOps - Chaos Engineering on Kubernetes
DevOps - Chaos Engineering on Kubernetes
 
Chaos is a ladder !
Chaos is a ladder !Chaos is a ladder !
Chaos is a ladder !
 
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
Nagios Conference 2011 - Nathan Vonnahme - Integrating Nagios With Test Drive...
 
Management of modes and states with Capella
Management of modes and states with CapellaManagement of modes and states with Capella
Management of modes and states with Capella
 
Dave Karow, Split. Powering Progressive Delivery With Data
Dave Karow, Split. Powering Progressive Delivery With DataDave Karow, Split. Powering Progressive Delivery With Data
Dave Karow, Split. Powering Progressive Delivery With Data
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentation
 
Code Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application MigrationsCode Coverage for Total Security in Application Migrations
Code Coverage for Total Security in Application Migrations
 
Agile Days Twin Cities 2011
Agile Days Twin Cities 2011Agile Days Twin Cities 2011
Agile Days Twin Cities 2011
 
testing for people who hate testing
testing for people who hate testingtesting for people who hate testing
testing for people who hate testing
 
JDD 2016 - Bartosz Majsak - Meet The Assertable Chaos Monkeys
JDD 2016 - Bartosz Majsak - Meet The Assertable Chaos Monkeys JDD 2016 - Bartosz Majsak - Meet The Assertable Chaos Monkeys
JDD 2016 - Bartosz Majsak - Meet The Assertable Chaos Monkeys
 
AdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutions
AdaCore Paris Tech Day 2016: Eric Perlade - Verification SolutionsAdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutions
AdaCore Paris Tech Day 2016: Eric Perlade - Verification Solutions
 
DevSecOps and the CI/CD Pipeline
 DevSecOps and the CI/CD Pipeline DevSecOps and the CI/CD Pipeline
DevSecOps and the CI/CD Pipeline
 
Introduction to Arquillian framework
Introduction to Arquillian  frameworkIntroduction to Arquillian  framework
Introduction to Arquillian framework
 
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOpsPVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
PVS-Studio Is Now in Chocolatey: Checking Chocolatey under Azure DevOps
 
Ms arch dev-ops
Ms arch dev-opsMs arch dev-ops
Ms arch dev-ops
 
Buying a Ferrari for your teenager? You may want to think twice
Buying a Ferrari for your teenager? You may want to think twiceBuying a Ferrari for your teenager? You may want to think twice
Buying a Ferrari for your teenager? You may want to think twice
 
Hyper-pragmatic Pure FP testing with distage-testkit
Hyper-pragmatic Pure FP testing with distage-testkitHyper-pragmatic Pure FP testing with distage-testkit
Hyper-pragmatic Pure FP testing with distage-testkit
 
Testing Django Applications
Testing Django ApplicationsTesting Django Applications
Testing Django Applications
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline Security
 
PyParis2018 - Python tooling for continuous deployment
PyParis2018 - Python tooling for continuous deploymentPyParis2018 - Python tooling for continuous deployment
PyParis2018 - Python tooling for continuous deployment
 

More from Bertrand Delacretaz

More from Bertrand Delacretaz (20)

VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?
 
Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity
 
Repoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initializationRepoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initialization
 
The Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationThe Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaboration
 
GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?
 
Open Source Changes the World!
Open Source Changes the World!Open Source Changes the World!
Open Source Changes the World!
 
How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...
 
L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019
 
Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?
 
Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?
 
Serverless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesServerless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètes
 
State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
 
Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)
 
They don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesThey don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenches
 
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
 
Project and Community Services the Apache Way
Project and Community Services the Apache WayProject and Community Services the Apache Way
Project and Community Services the Apache Way
 
La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017
 
Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017
 
Building an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBuilding an Apache Sling Rendering Farm
Building an Apache Sling Rendering Farm
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Taming your CQ/AEM instances with the Apache Sling Health Checks

  • 1. Sling  health  checks      -­‐      Bertrand  Delacretaz Tamingyour
 AEMinstances withthe
 ApacheSling HealthCheckTools BertrandDelacrétaz
 PrincipalScientist,AdobeCQ/AEMR&Dteam,Basel ApacheSlingcommitter,ASFMemberand(current)Director
 @bdelacretaz-grep.codeconsult.ch AEMHubLondon,April2014 slidesrevision2014-04–09,atslideshare.net/bdelacretaz
  • 2. Sling  health  checks      -­‐      Bertrand  Delacretaz picture: anitapeppers on morguefile.com How  can  you  trust  your   current  (fragile?)   combina?on  of  OSGi   bundles  and  configs?   ! It  needs  live   TESTING.  
  • 3. Sling  health  checks      -­‐      Bertrand  Delacretaz Test  code  in  my  produc?on  instance? picture: melschmitz on morguefile.com
  • 4. Sling  health  checks      -­‐      Bertrand  Delacretaz whatdowemeanby
 Health Checks?
  • 5. Sling  health  checks      -­‐      Bertrand  Delacretaz Health  Checks? public interface HealthCheck { Result execute(); } public class Result { public boolean isOk() ... public Status getStatus() ... public Iterator<ResultLog.Entry> iterator() ... } HealthCheck
 OSGi services Serviceprops:
 name,MBean,tags
  • 6. Sling  health  checks      -­‐      Bertrand  Delacretaz Webconsoleand JMX
  • 7. Sling  health  checks      -­‐      Bertrand  Delacretaz Webconsole  /system/console/healthcheck
  • 8. Sling  health  checks      -­‐      Bertrand  Delacretaz Health  Check  MBeans  (auto-­‐created) Serviceprops
 : name,MBean,tags
  • 9. Sling  health  checks      -­‐      Bertrand  Delacretaz Health  Checks  as  JMX  Processors MBean MBean MBean HC HC HC using expressions like
 jmx.attribute('java.lang:type=ClassLoading', 'LoadedClassCount') > 10 
 
 && jmx.attribute('java.lang:type=Runtime', 'ManagementSpecVersion') > 1
  • 10. Sling  health  checks      -­‐      Bertrand  Delacretaz JMX  ResourceProvider curl http://localhost:8080/system/sling/monitoring/mbeans/...queriesStatus.tidy.2.json { "mbean:objectName": 
 “org.apache.sling.healthcheck:name=qs,type=HealthCheck", "sling:resourceType": "sling:mbean", "hc.name": "Query Performance", "mbean:description": "Health check", "status": "OK", "log": …
  • 11. Sling  health  checks      -­‐      Bertrand  Delacretaz herecomesthe
 big(?)





 demo! (webconsole,JMX,configuration)
  • 12. Sling  health  checks      -­‐      Bertrand  Delacretaz typicalUseCases
  • 13. Sling  health  checks      -­‐      Bertrand  Delacretaz Typical  Use  Cases System status Allbundlesup? Initialcontentready? Diskspaceok? Externalservicesok? Loadwithinbounds?(forjobs) Performance Requestspersecondok? Requestdurationok? Freememoryok? Replicationqueuesok? Configuration Securitychecklistok? Defaultaccountsdisabled? Democontentremoved? Self-test Startupsmoketests? Keephistoryofresults? ReporttoHTTPfront-end http://bit.ly/Qjxh93 TalktoJustinEdelson!
  • 14. Sling  health  checks      -­‐      Bertrand  Delacretaz Sling  devops  experiments https://github.com/bdelacretaz/ sling-devops-vol1 Health checks tell the cluster controller when a Sling instance is ready to be injected in the cluster.
  • 15. Sling  health  checks      -­‐      Bertrand  Delacretaz whatdoyouget
 Outofthebox?
  • 16. Sling  health  checks      -­‐      Bertrand  Delacretaz Out  of  the  Box  -­‐  core JmxAttributeHealthCheck ScriptableHealthCheck CompositeHealthCheck Single JMX attributes Script(let)s in any language
 using BindingValuesProviders
 Run other Health Checks based on their tags
  • 17. Sling  health  checks      -­‐      Bertrand  Delacretaz Out  of  the  box  -­‐  support  bundle SlingRequestStatusHC DefaultLoginsHealthCheck Is my resource there? Including its scripts? admin:admin -> fail? current HC bundles: org.apache.sling.hc.core org.apache.sling.hc.support org.apache.sling.hc.webconsole org.apache.sling.hc.samples JUnitHealthCheck And also: From the junit.healthcheck bundle
  • 18. Sling  health  checks      -­‐      Bertrand  Delacretaz howdoyouwrite
 YourownHealth Checks?
  • 19. Sling  health  checks      -­‐      Bertrand  Delacretaz BYOHC  -­‐  Bring  Your  Own  HCs  ! @Component(...policy=ConfigurationPolicy.REQUIRE, metatype=true) @Service(value=HealthCheck.class) ! @Property(name=HealthCheck.NAME), @Property(name=HealthCheck.TAGS,unbounded=PropertyUnbounded.ARRAY), @Property(name=HealthCheck.MBEAN_NAME) ! public class MyHealthCheck { public Result execute() { FormattingResultLog f = new FormattingResultLog(); ... if(badThings) f.warn(“Something happened with {}”, foo); return new Result(f); } }
  • 20. Sling  health  checks      -­‐      Bertrand  Delacretaz HealthChecksExecutor
  • 21. Sling  health  checks      -­‐      Bertrand  Delacretaz Health  Check  Executor  Service public interface HealthCheckExecutor { ! List<HealthCheckExecutionResult>
 execute(String... tags); ! } ExecutesHCsselectedbytags,withcaching. Resultincludesexecutionmetadata,timeoutinfoetc.
  • 22. Sling  health  checks      -­‐      Bertrand  Delacretaz docs at sling.apache.org : bundles : health check. discuss on the Apache Sling dev list. I’m @bdelacretaz - thanks! JMX processors Webconsole JmxAttributeHealthCheck ScriptableHealthCheck CompositeHealthCheck SlingRequestStatusHC DefaultLoginsHealthCheck JUnitHealthCheck That’s  it!  Have  fun. @Service(HealthCheck.class)
 public class MyHealthCheck { ....generate a Result here… }