SlideShare ist ein Scribd-Unternehmen logo
1 von 20
Downloaden Sie, um offline zu lesen
CQ5
HealthCheck
Automated self-testing
and health check
of live CQ instances
Bertrand Delacrétaz
Senior R&D Developer, Adobe Basel
@bdelacretaz, grep.codeconsult.ch
CQCon, Basel, June 2013
slides revision 2013-06-19
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
picture: anitapeppers on morguefile.com
Themore
configurable,the
morebreakable....let's
testitlive!
Agile software
needs
TESTING
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Apache Sling Health Check
Webconsole plugin
Rules configured in content
Tagged rules
Webconsole and servlets
RuleBuilder OSGi services
ApacheSling
module,runsin
CQ5.5and
later
Muppet
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
JSON output selectors map to tags
no news (log) is good news!
Rule uses a Logger to complain
rule 1
rule 2
rules
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Rule defined in content
$ curl -u admin:admin
http://localhost:4502/apps/hc/demo/inactive-bundles.tidy.json
{
"sling:resourceType": "sling/healthcheck/rules",
"namespace": "osgi",
"ruleName": "inactive.bundles.count",
"expression": "<= 3",
"tags": [
"bundles",
"osgi",
"sling"
],
"jcr:primaryType": "nt:unstructured"
}
Execute the osgi:inactive.bundles.count rule
and verify that its output is <= 3
The rules engine executes a tree of such definitions, optionally taking tags into account.
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
HTTP rule execution
$ curl -u admin:admin
http://localhost:4502/apps/hc/demo/inactive-bundles.healthcheck.json
{
"results": [{
"rule": "Rule: InactiveBundlesCount <= 3",
"info": [{
"sling.resource.path": "/apps/hc/demo/inactive-bundles"
}
],
"tags": [
"sling",
"bundles",
"osgi"
]
}
]
}
Rule path with .healthcheck selector
Works with single rules or trees
no news (log) is good news!
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Rule scripts
$ curl -u admin:admin
http://localhost:4502/apps/hc/demo/script-that-passes.esp
# A rule script must output only TEST_PASSED,
# comments like this one and white space.
# Anything else is considered failure
#(as with the Sling testing tools)
TEST_PASSED
Currently executable only from a
sling/healthcheck/rules container resource.
#thesky
isthelimit
outof the
box
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Out of the box rulesas of revision 1490454
JMX
beans attributes
jmxbeans:
org.apache.sling:
type=engine,
service=RequestProcessor
RequestsCount < 20
JUnit
tests
junit:
org.apache.sling.hc.demo.tests.ResourcesExistTest
(can use @TestReference for services)
OSGi
bundle
state
osgi:
bundle.state
org.apache.sling.startupfilter.disabler
= active
OSGi
inactive
bundles
osgi:
inactive.bundles.count < 3
Sling default
logins fail
sling:
loginfails
admin#admin
picture:mconnorsonmorguefile.com
Sling
scripts
/apps/hc/demo/somescript.esp
BYOR!
extensibili t y
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Rule evaluates a SystemAttribute
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
RuleBuilder service builds Rules
check namespace
map ruleName to
SystemAttribute
build Rule
test:constant:5 = 5
namespace:ruleName:qualifier expr
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
DefaultEvaluator expressionscan use custom Evaluator as well
“Some string”
< 5
> 5
<= 5
>= 5
between 5 and 12
public interface Evaluator {
void evaluate(
SystemAttribute a,
String expression,
Logger logger);
}
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Extensibility summary
Implement a SystemAttribute
getValue(Logger)
Register a RuleBuilder service
check names
build SystemAttribute + Rule
That’s it.
(optionally supply custom Evaluator)
similar
ideas
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Joerg Hoh’s cq5-healthcheck
https://github.com/joerghoh/cq5-healthcheck
PID = de.joerghoh.cq5.healthcheck.MBeanStatusProvider.b9cb0c91-972b
mbean.name = com.adobe.granite.replication:type=agent,id="publish"
mbean.property = QueueNumEntries.warn.>.100
mbean.providerHint = Warn Queue length
MBean attribute value
ranges or custom
StatusProvider services
CQ:Page for status
Based on OSGi configs:
CQ5
HealthCheck Bertrand Delacrétaz, Adobe Basel
Davide Giannella’s sanitycheck
Adobe Internal github for now: dgiannel/sanitycheck
Servlets as sanity
check services.
CQ page components
for options, forms.
Checks remote CQ
instances via HTTP.
CQ pages to assemble
sanity check pages.
future
CQ5
HealthCheck
Future?
Implement CQ security checklist rules
Execute rules via JMX?
Scheduling of rules execution + reporting
Scheduling and time-based range checks, sampling
periods (thx Radu Cotescu)
Whatareyour
usecases?
Execute rules tagged “startup” at startup
and report or lock instance if WARN.
http://sling.apache.org/documentation/bundles/sling-health-check-tool.html
I’m @bdelacretaz - thanks for attending!
<YOUR IDEA HERE> or on the Apache Sling mailing lists

Weitere ähnliche Inhalte

Ähnlich wie Automated self-testing and health check of CQ and Sling instances

Spring batch for large enterprises operations
Spring batch for large enterprises operations Spring batch for large enterprises operations
Spring batch for large enterprises operations Ignasi González
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9Ivan Krylov
 
Why so continuous
Why so continuousWhy so continuous
Why so continuousMax Lobur
 
Test automation introduction training at Polteq
Test automation   introduction training at PolteqTest automation   introduction training at Polteq
Test automation introduction training at PolteqMartijn de Vrieze
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Matt Fuller
 
WebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsWebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsChris Bailey
 
Continuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsContinuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsEvgeniy Kuzmin
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Ontico
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIAndrey Karpov
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravelConfiz
 
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...apidays
 
Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeCybera Inc.
 
Unit testing with Spock Framework
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock FrameworkEugene Dvorkin
 
Continuous integration / continuous delivery
Continuous integration / continuous deliveryContinuous integration / continuous delivery
Continuous integration / continuous deliveryEatDog
 
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...Andrea Dottor
 
Webinar | Building Apps with the Cassandra Python Driver
Webinar | Building Apps with the Cassandra Python DriverWebinar | Building Apps with the Cassandra Python Driver
Webinar | Building Apps with the Cassandra Python DriverDataStax Academy
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Elixir Club
 
Web service with Laravel
Web service with LaravelWeb service with Laravel
Web service with LaravelAbuzer Firdousi
 

Ähnlich wie Automated self-testing and health check of CQ and Sling instances (20)

Spring batch for large enterprises operations
Spring batch for large enterprises operations Spring batch for large enterprises operations
Spring batch for large enterprises operations
 
What to expect from Java 9
What to expect from Java 9What to expect from Java 9
What to expect from Java 9
 
Why so continuous
Why so continuousWhy so continuous
Why so continuous
 
Test automation introduction training at Polteq
Test automation   introduction training at PolteqTest automation   introduction training at Polteq
Test automation introduction training at Polteq
 
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
Presto Testing Tools: Benchto & Tempto (Presto Boston Meetup 10062015)
 
Maximizing Oracle RAC Uptime
Maximizing Oracle RAC UptimeMaximizing Oracle RAC Uptime
Maximizing Oracle RAC Uptime
 
WebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic ToolsWebSphere Technical University: Introduction to the Java Diagnostic Tools
WebSphere Technical University: Introduction to the Java Diagnostic Tools
 
Continuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applicationsContinuous Integration/ Continuous Delivery of web applications
Continuous Integration/ Continuous Delivery of web applications
 
Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)Everything as a Code / Александр Тарасов (Одноклассники)
Everything as a Code / Александр Тарасов (Одноклассники)
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
PVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCIPVS-Studio in the Clouds: CircleCI
PVS-Studio in the Clouds: CircleCI
 
Web services with laravel
Web services with laravelWeb services with laravel
Web services with laravel
 
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
apidays Australia 2023 - Unlocking The Power: The Importance Of API Registrat...
 
Test Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as CodeTest Kitchen and Infrastructure as Code
Test Kitchen and Infrastructure as Code
 
Unit testing with Spock Framework
Unit testing with Spock FrameworkUnit testing with Spock Framework
Unit testing with Spock Framework
 
Continuous integration / continuous delivery
Continuous integration / continuous deliveryContinuous integration / continuous delivery
Continuous integration / continuous delivery
 
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
Come sta la nostra applicazione? Un viaggio alla scoperta degli Health Check ...
 
Webinar | Building Apps with the Cassandra Python Driver
Webinar | Building Apps with the Cassandra Python DriverWebinar | Building Apps with the Cassandra Python Driver
Webinar | Building Apps with the Cassandra Python Driver
 
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
 
Web service with Laravel
Web service with LaravelWeb service with Laravel
Web service with Laravel
 

Mehr von Bertrand Delacretaz

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?Bertrand Delacretaz
 
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 Bertrand Delacretaz
 
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 initializationBertrand Delacretaz
 
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 collaborationBertrand Delacretaz
 
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?Bertrand Delacretaz
 
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...Bertrand Delacretaz
 
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 2019Bertrand Delacretaz
 
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?Bertrand Delacretaz
 
Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Bertrand Delacretaz
 
Serverless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesServerless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesBertrand Delacretaz
 
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 2018Bertrand Delacretaz
 
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?Bertrand Delacretaz
 
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)Bertrand Delacretaz
 
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 trenchesBertrand Delacretaz
 
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)Bertrand Delacretaz
 
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 WayBertrand Delacretaz
 
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 2017Bertrand Delacretaz
 
Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Bertrand Delacretaz
 
Building an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBuilding an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBertrand Delacretaz
 

Mehr von 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
 

Kürzlich hochgeladen

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 

Kürzlich hochgeladen (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 

Automated self-testing and health check of CQ and Sling instances

  • 1. CQ5 HealthCheck Automated self-testing and health check of live CQ instances Bertrand Delacrétaz Senior R&D Developer, Adobe Basel @bdelacretaz, grep.codeconsult.ch CQCon, Basel, June 2013 slides revision 2013-06-19
  • 2. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel picture: anitapeppers on morguefile.com Themore configurable,the morebreakable....let's testitlive! Agile software needs TESTING
  • 3. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Apache Sling Health Check Webconsole plugin Rules configured in content Tagged rules Webconsole and servlets RuleBuilder OSGi services ApacheSling module,runsin CQ5.5and later Muppet
  • 4. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel JSON output selectors map to tags no news (log) is good news! Rule uses a Logger to complain rule 1 rule 2
  • 6. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Rule defined in content $ curl -u admin:admin http://localhost:4502/apps/hc/demo/inactive-bundles.tidy.json { "sling:resourceType": "sling/healthcheck/rules", "namespace": "osgi", "ruleName": "inactive.bundles.count", "expression": "<= 3", "tags": [ "bundles", "osgi", "sling" ], "jcr:primaryType": "nt:unstructured" } Execute the osgi:inactive.bundles.count rule and verify that its output is <= 3 The rules engine executes a tree of such definitions, optionally taking tags into account.
  • 7. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel HTTP rule execution $ curl -u admin:admin http://localhost:4502/apps/hc/demo/inactive-bundles.healthcheck.json { "results": [{ "rule": "Rule: InactiveBundlesCount <= 3", "info": [{ "sling.resource.path": "/apps/hc/demo/inactive-bundles" } ], "tags": [ "sling", "bundles", "osgi" ] } ] } Rule path with .healthcheck selector Works with single rules or trees no news (log) is good news!
  • 8. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Rule scripts $ curl -u admin:admin http://localhost:4502/apps/hc/demo/script-that-passes.esp # A rule script must output only TEST_PASSED, # comments like this one and white space. # Anything else is considered failure #(as with the Sling testing tools) TEST_PASSED Currently executable only from a sling/healthcheck/rules container resource. #thesky isthelimit
  • 10. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Out of the box rulesas of revision 1490454 JMX beans attributes jmxbeans: org.apache.sling: type=engine, service=RequestProcessor RequestsCount < 20 JUnit tests junit: org.apache.sling.hc.demo.tests.ResourcesExistTest (can use @TestReference for services) OSGi bundle state osgi: bundle.state org.apache.sling.startupfilter.disabler = active OSGi inactive bundles osgi: inactive.bundles.count < 3 Sling default logins fail sling: loginfails admin#admin picture:mconnorsonmorguefile.com Sling scripts /apps/hc/demo/somescript.esp BYOR!
  • 12. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Rule evaluates a SystemAttribute
  • 13. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel RuleBuilder service builds Rules check namespace map ruleName to SystemAttribute build Rule test:constant:5 = 5 namespace:ruleName:qualifier expr
  • 14. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel DefaultEvaluator expressionscan use custom Evaluator as well “Some string” < 5 > 5 <= 5 >= 5 between 5 and 12 public interface Evaluator { void evaluate( SystemAttribute a, String expression, Logger logger); }
  • 15. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Extensibility summary Implement a SystemAttribute getValue(Logger) Register a RuleBuilder service check names build SystemAttribute + Rule That’s it. (optionally supply custom Evaluator)
  • 17. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Joerg Hoh’s cq5-healthcheck https://github.com/joerghoh/cq5-healthcheck PID = de.joerghoh.cq5.healthcheck.MBeanStatusProvider.b9cb0c91-972b mbean.name = com.adobe.granite.replication:type=agent,id="publish" mbean.property = QueueNumEntries.warn.>.100 mbean.providerHint = Warn Queue length MBean attribute value ranges or custom StatusProvider services CQ:Page for status Based on OSGi configs:
  • 18. CQ5 HealthCheck Bertrand Delacrétaz, Adobe Basel Davide Giannella’s sanitycheck Adobe Internal github for now: dgiannel/sanitycheck Servlets as sanity check services. CQ page components for options, forms. Checks remote CQ instances via HTTP. CQ pages to assemble sanity check pages.
  • 20. CQ5 HealthCheck Future? Implement CQ security checklist rules Execute rules via JMX? Scheduling of rules execution + reporting Scheduling and time-based range checks, sampling periods (thx Radu Cotescu) Whatareyour usecases? Execute rules tagged “startup” at startup and report or lock instance if WARN. http://sling.apache.org/documentation/bundles/sling-health-check-tool.html I’m @bdelacretaz - thanks for attending! <YOUR IDEA HERE> or on the Apache Sling mailing lists