SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
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…
}

Más contenido relacionado

Similar a Sling health Checks by Bertrand Delacretaz

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...Nagios
 
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 CapellaObeo
 
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 DataIT Arena
 
Apache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationApache Maven - eXo VN office presentation
Apache Maven - eXo VN office presentationArnaud Héritier
 
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 MigrationsDana Luther
 
Agile Days Twin Cities 2011
Agile Days Twin Cities 2011Agile Days Twin Cities 2011
Agile Days Twin Cities 2011Brian Repko
 
testing for people who hate testing
testing for people who hate testingtesting for people who hate testing
testing for people who hate testingBram Vogelaar
 
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 PROIDEA
 
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 Solutionsjamieayre
 
DevSecOps and the CI/CD Pipeline
 DevSecOps and the CI/CD Pipeline DevSecOps and the CI/CD Pipeline
DevSecOps and the CI/CD PipelineJames Wickett
 
Introduction to Arquillian framework
Introduction to Arquillian  frameworkIntroduction to Arquillian  framework
Introduction to Arquillian frameworkKarthikeyan Annamalai
 
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 DevOpsAndrey Karpov
 
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 twiceAl Zindiq
 
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-testkit7mind
 
Testing Django Applications
Testing Django ApplicationsTesting Django Applications
Testing Django ApplicationsGareth Rushgrove
 
Pragmatic Pipeline Security
Pragmatic Pipeline SecurityPragmatic Pipeline Security
Pragmatic Pipeline SecurityJames Wickett
 
PyParis2018 - Python tooling for continuous deployment
PyParis2018 - Python tooling for continuous deploymentPyParis2018 - Python tooling for continuous deployment
PyParis2018 - Python tooling for continuous deploymentArthur Lutz
 
Integration Testing on Steroids: Run Your Tests on the Real Things
Integration Testing on Steroids: Run Your Tests on the Real ThingsIntegration Testing on Steroids: Run Your Tests on the Real Things
Integration Testing on Steroids: Run Your Tests on the Real ThingsAtlassian
 

Similar a Sling health Checks by Bertrand Delacretaz (20)

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
 
Integration Testing on Steroids: Run Your Tests on the Real Things
Integration Testing on Steroids: Run Your Tests on the Real ThingsIntegration Testing on Steroids: Run Your Tests on the Real Things
Integration Testing on Steroids: Run Your Tests on the Real Things
 

Más de AEM HUB

Microservices for AEM by Maciej Majchrzak
Microservices for AEM by Maciej MajchrzakMicroservices for AEM by Maciej Majchrzak
Microservices for AEM by Maciej MajchrzakAEM HUB
 
When dispatcher caching is not enough by Jakub Wądołowski
When dispatcher caching is not enough by Jakub WądołowskiWhen dispatcher caching is not enough by Jakub Wądołowski
When dispatcher caching is not enough by Jakub WądołowskiAEM HUB
 
Sling Models Using Sightly and JSP by Deepak Khetawat
Sling Models Using Sightly and JSP by Deepak KhetawatSling Models Using Sightly and JSP by Deepak Khetawat
Sling Models Using Sightly and JSP by Deepak KhetawatAEM HUB
 
PhoneGap Enterprise Viewer by Anthony Rumsey
PhoneGap Enterprise Viewer by Anthony RumseyPhoneGap Enterprise Viewer by Anthony Rumsey
PhoneGap Enterprise Viewer by Anthony RumseyAEM HUB
 
Integrating Apache Wookie with AEM by Rima Mittal and Ankit Gubrani
Integrating Apache Wookie with AEM by Rima Mittal and Ankit GubraniIntegrating Apache Wookie with AEM by Rima Mittal and Ankit Gubrani
Integrating Apache Wookie with AEM by Rima Mittal and Ankit GubraniAEM HUB
 
Mastering the Sling Rewriter by Justin Edelson
Mastering the Sling Rewriter by Justin EdelsonMastering the Sling Rewriter by Justin Edelson
Mastering the Sling Rewriter by Justin EdelsonAEM HUB
 
Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...AEM HUB
 
Touching the AEM component dialog by Mateusz Chromiński
Touching the AEM component dialog by Mateusz ChromińskiTouching the AEM component dialog by Mateusz Chromiński
Touching the AEM component dialog by Mateusz ChromińskiAEM HUB
 
How to build a Social Intranet with Adobe Sites and 3rd Party products ... us...
How to build a Social Intranet with Adobe Sites and 3rd Party products ... us...How to build a Social Intranet with Adobe Sites and 3rd Party products ... us...
How to build a Social Intranet with Adobe Sites and 3rd Party products ... us...AEM HUB
 
How do you build flexible platforms that focuses on business needs? by Fahim...
How do you build flexible platforms that focuses on business needs?  by Fahim...How do you build flexible platforms that focuses on business needs?  by Fahim...
How do you build flexible platforms that focuses on business needs? by Fahim...AEM HUB
 
AEM Apps Enhanced: In-app Messaging and Beacons by John Fait
AEM Apps Enhanced: In-app Messaging and Beacons by John FaitAEM Apps Enhanced: In-app Messaging and Beacons by John Fait
AEM Apps Enhanced: In-app Messaging and Beacons by John FaitAEM HUB
 
Effectively Scale and Operate AEM with MongoDB by Norberto Leite
Effectively Scale and Operate AEM with MongoDB by Norberto LeiteEffectively Scale and Operate AEM with MongoDB by Norberto Leite
Effectively Scale and Operate AEM with MongoDB by Norberto LeiteAEM HUB
 
Adobe Managed Services: Complicated Cloud Deployments by Adam Pazik, Mike Til...
Adobe Managed Services: Complicated Cloud Deployments by Adam Pazik, Mike Til...Adobe Managed Services: Complicated Cloud Deployments by Adam Pazik, Mike Til...
Adobe Managed Services: Complicated Cloud Deployments by Adam Pazik, Mike Til...AEM HUB
 
Adobe Marketing Cloud Integrations: Myth or Reality? by Holger Marsen
Adobe Marketing Cloud Integrations: Myth or Reality? by Holger MarsenAdobe Marketing Cloud Integrations: Myth or Reality? by Holger Marsen
Adobe Marketing Cloud Integrations: Myth or Reality? by Holger MarsenAEM HUB
 
Responsive Websites and Grid-Based Layouts by Gabriel Walt
Responsive Websites and Grid-Based Layouts by Gabriel Walt Responsive Websites and Grid-Based Layouts by Gabriel Walt
Responsive Websites and Grid-Based Layouts by Gabriel Walt AEM HUB
 
When Sightly Meets Slice by Tomasz Niedźwiedź
When Sightly Meets Slice by Tomasz NiedźwiedźWhen Sightly Meets Slice by Tomasz Niedźwiedź
When Sightly Meets Slice by Tomasz NiedźwiedźAEM HUB
 
Creativity without comprise by Cleve Gibbon
Creativity without comprise by Cleve Gibbon Creativity without comprise by Cleve Gibbon
Creativity without comprise by Cleve Gibbon AEM HUB
 
REST in AEM by Roy Fielding
REST in AEM by Roy FieldingREST in AEM by Roy Fielding
REST in AEM by Roy FieldingAEM HUB
 
Adobe Summit 2015 - Penguin Random House - Accelerating Digital Transformation
Adobe Summit 2015 - Penguin Random House - Accelerating Digital TransformationAdobe Summit 2015 - Penguin Random House - Accelerating Digital Transformation
Adobe Summit 2015 - Penguin Random House - Accelerating Digital TransformationAEM HUB
 
Socialize your Exceptional Web Experience – Adobe AEM & IBM Connections by He...
Socialize your Exceptional Web Experience – Adobe AEM & IBM Connections by He...Socialize your Exceptional Web Experience – Adobe AEM & IBM Connections by He...
Socialize your Exceptional Web Experience – Adobe AEM & IBM Connections by He...AEM HUB
 

Más de AEM HUB (20)

Microservices for AEM by Maciej Majchrzak
Microservices for AEM by Maciej MajchrzakMicroservices for AEM by Maciej Majchrzak
Microservices for AEM by Maciej Majchrzak
 
When dispatcher caching is not enough by Jakub Wądołowski
When dispatcher caching is not enough by Jakub WądołowskiWhen dispatcher caching is not enough by Jakub Wądołowski
When dispatcher caching is not enough by Jakub Wądołowski
 
Sling Models Using Sightly and JSP by Deepak Khetawat
Sling Models Using Sightly and JSP by Deepak KhetawatSling Models Using Sightly and JSP by Deepak Khetawat
Sling Models Using Sightly and JSP by Deepak Khetawat
 
PhoneGap Enterprise Viewer by Anthony Rumsey
PhoneGap Enterprise Viewer by Anthony RumseyPhoneGap Enterprise Viewer by Anthony Rumsey
PhoneGap Enterprise Viewer by Anthony Rumsey
 
Integrating Apache Wookie with AEM by Rima Mittal and Ankit Gubrani
Integrating Apache Wookie with AEM by Rima Mittal and Ankit GubraniIntegrating Apache Wookie with AEM by Rima Mittal and Ankit Gubrani
Integrating Apache Wookie with AEM by Rima Mittal and Ankit Gubrani
 
Mastering the Sling Rewriter by Justin Edelson
Mastering the Sling Rewriter by Justin EdelsonMastering the Sling Rewriter by Justin Edelson
Mastering the Sling Rewriter by Justin Edelson
 
Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...
 
Touching the AEM component dialog by Mateusz Chromiński
Touching the AEM component dialog by Mateusz ChromińskiTouching the AEM component dialog by Mateusz Chromiński
Touching the AEM component dialog by Mateusz Chromiński
 
How to build a Social Intranet with Adobe Sites and 3rd Party products ... us...
How to build a Social Intranet with Adobe Sites and 3rd Party products ... us...How to build a Social Intranet with Adobe Sites and 3rd Party products ... us...
How to build a Social Intranet with Adobe Sites and 3rd Party products ... us...
 
How do you build flexible platforms that focuses on business needs? by Fahim...
How do you build flexible platforms that focuses on business needs?  by Fahim...How do you build flexible platforms that focuses on business needs?  by Fahim...
How do you build flexible platforms that focuses on business needs? by Fahim...
 
AEM Apps Enhanced: In-app Messaging and Beacons by John Fait
AEM Apps Enhanced: In-app Messaging and Beacons by John FaitAEM Apps Enhanced: In-app Messaging and Beacons by John Fait
AEM Apps Enhanced: In-app Messaging and Beacons by John Fait
 
Effectively Scale and Operate AEM with MongoDB by Norberto Leite
Effectively Scale and Operate AEM with MongoDB by Norberto LeiteEffectively Scale and Operate AEM with MongoDB by Norberto Leite
Effectively Scale and Operate AEM with MongoDB by Norberto Leite
 
Adobe Managed Services: Complicated Cloud Deployments by Adam Pazik, Mike Til...
Adobe Managed Services: Complicated Cloud Deployments by Adam Pazik, Mike Til...Adobe Managed Services: Complicated Cloud Deployments by Adam Pazik, Mike Til...
Adobe Managed Services: Complicated Cloud Deployments by Adam Pazik, Mike Til...
 
Adobe Marketing Cloud Integrations: Myth or Reality? by Holger Marsen
Adobe Marketing Cloud Integrations: Myth or Reality? by Holger MarsenAdobe Marketing Cloud Integrations: Myth or Reality? by Holger Marsen
Adobe Marketing Cloud Integrations: Myth or Reality? by Holger Marsen
 
Responsive Websites and Grid-Based Layouts by Gabriel Walt
Responsive Websites and Grid-Based Layouts by Gabriel Walt Responsive Websites and Grid-Based Layouts by Gabriel Walt
Responsive Websites and Grid-Based Layouts by Gabriel Walt
 
When Sightly Meets Slice by Tomasz Niedźwiedź
When Sightly Meets Slice by Tomasz NiedźwiedźWhen Sightly Meets Slice by Tomasz Niedźwiedź
When Sightly Meets Slice by Tomasz Niedźwiedź
 
Creativity without comprise by Cleve Gibbon
Creativity without comprise by Cleve Gibbon Creativity without comprise by Cleve Gibbon
Creativity without comprise by Cleve Gibbon
 
REST in AEM by Roy Fielding
REST in AEM by Roy FieldingREST in AEM by Roy Fielding
REST in AEM by Roy Fielding
 
Adobe Summit 2015 - Penguin Random House - Accelerating Digital Transformation
Adobe Summit 2015 - Penguin Random House - Accelerating Digital TransformationAdobe Summit 2015 - Penguin Random House - Accelerating Digital Transformation
Adobe Summit 2015 - Penguin Random House - Accelerating Digital Transformation
 
Socialize your Exceptional Web Experience – Adobe AEM & IBM Connections by He...
Socialize your Exceptional Web Experience – Adobe AEM & IBM Connections by He...Socialize your Exceptional Web Experience – Adobe AEM & IBM Connections by He...
Socialize your Exceptional Web Experience – Adobe AEM & IBM Connections by He...
 

Último

Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesMd Hossain Ali
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?SANGHEE SHIN
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServiceRenan Moreira de Oliveira
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum ComputingGDSC PJATK
 

Último (20)

Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just MinutesAI Fame Rush Review – Virtual Influencer Creation In Just Minutes
AI Fame Rush Review – Virtual Influencer Creation In Just Minutes
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer ServicePicPay - GenAI Finance Assistant - ChatGPT for Customer Service
PicPay - GenAI Finance Assistant - ChatGPT for Customer Service
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum Computing
 

Sling health Checks by Bertrand Delacretaz

  • 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… }