SlideShare a Scribd company logo
1 of 25
May 26th, 2021
¿Cómo generar e implementar
monitoreo para aplicaciones de
Mule?
Paola Alcantar Valdes
2
● About me
● What is a Health Monitoring
● Importance of implementing a Health Monitoring
● Health Monitoring application objectives
● Application metricts to watch
● Building a basic Health Monitoring for Mule Application
● How to implement a Health Monitoring Library in a Mule Application
● DEMO – Basic Health Monitoring for Mule Application
● Questions
Agenda
3
●Paola Alcantar Valdes
○ Jr. Integration Engineer with Mulesoft at Twitter
○ Mulesoft Certified Developer – Level 1 (Mule 4)
○ Over two years of experience as a Managed Services
About me
Importance of implementing a health monitoring
What is a Health Monitoring?
5
● What is a Health Monitoring?
○ It is an application that continually checks the status of an integration that is running.
● Differences between Application Health Monitoring and Application Health Checks:
○ Application Health Monitoring:
○ It is a good practice that allows collecting key metrics about different aspects of an application to
watch how it's working over time.
○ Application Health Checks:
○ Definition of “healthy” parameters based on regular checks information to ensure the system is
working the way it’s expected to.
○ Based on a business logic criteria, this should not be just “black“ or “white“
Health Monitoring
6
● Importance of implementing a Health Monitoring:
○ It allows you to detect issues before they become complete outages. It will help you to detect
incidents before they affect customers.
○ Building and implementing a health monitoring application will help you create an action plan if an
incident does pop up.
○ A health monitoring application will allow helping you to understand better the behavior of
applications, servers, external systems. Also, to close visibility and performance gaps, correct
processes, and ensure you're getting total value from your applications.
Health Monitoring
Application metricts to watch
Health Monitoring application
objectives
8
● There is no single way to build health monitoring for your applications. It is why different IT
teams will have different perspectives about the thing you need to care about. However, a
basic and useful health monitoring application might consider the following aspects.
○ Application’s general information: Get application name, application version, application environment,
mule runtime version, etc.
○ Memory Information: Get Heap Memory, Non-Heap Memory, Garbage Collection information from JVM.
○ Thread information: Return the number of demon threads, non-demon threads, and peak threads.
○ Overall availability (External systems): Retrieve the status of the external system with which the
application interacts (Know if external systems are up-and-running or not).
Health Monitoring application objectives
9
● Application’s general information:
Health Monitoring application objectives
%dw 2.0
output application/json
---
{
apiName: app.name,
apiVersion: p("apiVersion") default "",
env: p("env") default "",
runtimeVersion: mule.version,
startDate: ((app.muleContext.startDate default now()) as DateTime
{unit: "milliseconds"}),
timeZone: server.timeZone,
traceId: correlationId,
}
10
● Memory Information :
Health Monitoring application objectives
public static void heapMemoryDetails() {
MemoryMXBean memBean = ManagementFactory.getMemoryMXBean() ;
MemoryUsage heapMemoryUsage = memBean.getHeapMemoryUsage();
long heapInitSize = heapMemoryUsage.getInit();
long heapUsedSize = heapMemoryUsage.getUsed();
long heapCommitedSize = heapMemoryUsage.getCommitted();
long heapMaxSize = heapMemoryUsage.getMax();
}
11
● Garbage Collection Information :
Health Monitoring application objectives
public static ArrayList<GarbageCollection> garbageCollection(){
ArrayList<GarbageCollectorMXBean> memBean =
(ArrayList<GarbageCollectorMXBean>)
ManagementFactory.getGarbageCollectorMXBeans();
ArrayList<GarbageCollection> gc = new
ArrayList<GarbageCollection>();
for (GarbageCollectorMXBean garbageCollectorMXBean : memBean)
{
gc.add(new
GarbageCollection(garbageCollectorMXBean.getName(),
garbageCollectorMXBean.getCollectionCount(),
garbageCollectorMXBean.getCollectionTime()));
}
return gc;
}
12
● Thread information :
Health Monitoring application objectives
public static void threadInformation() {
int demonThreads =
ManagementFactory.getThreadMXBean().getDaemonThreadCount();
int peakThreads =
ManagementFactory.getThreadMXBean().getPeakThreadCount();
int threadCount =
ManagementFactory.getThreadMXBean().getThreadCount();
long startedThreadCount =
ManagementFactory.getThreadMXBean().getTotalStartedThreadCount();
}
Building a basic Health
Monitoring for Mule Application
14
1. Create a Mule 4 application.
2. Update the pom.xml file to define the “classifier” of the mule application as a “mule-plugin”.
3. Define the endpoints for the health monitoring library in a RAML Definition file. For example:
○ /health/application
○ /health/server
○ /health/thirdParty
○ /health/general
Walkthrough: How to build a Health Monitoring for
Mule Applications
See Health Monitoring RAML Definition
File
15
4. Define the response for each endpoint.
5. Generate Flows based on RAML Definition file.
6. Remove auto-generated HTTP Configuration.
7. Set “config-ref” value on HTTP Listener Configuration with “${health.http.config}”
Walkthrough: How to build a Health Monitoring for
Mule Applications
See Health Monitoring application
objectives
Note: Value of “health.http.config” property will be defined in each mule
application that implements health monitoring library.
16
8. Get objective keys related to each endpoint.
9. Generate dataweave scripts to format endpoint responses. For example:
10. Install our health monitoring plugin into a repository using command mvn clean install.
11. Implement health monitoring library following next steps.
Walkthrough: How to build a Health Monitoring for
Mule Applications
See Health Monitoring RAML Definition
File
%dw 2.0
output application/json
---
{
apiName: app.name,
apiVersion: p("apiVersion") default "",
env: p("env") default "",
runtimeVersion: mule.version,
startDate: ((app.muleContext.startDate default now()) as DateTime {unit: "milliseconds"}),
timeZone: server.timeZone,
traceId: correlationId,
}
How to implement a Health
Monitoring Library in a Mule
Application
Walkthrough: How to implement a Health
Monitoring Library
1. Add the Health Monitoring library dependency to our mule application pom.xml file.
2. Import into our mule application the mule configuration files from the library.
3. Define the following properties into our mule application. The thirdPartyFlows property is
optional and does not need to be defined.
18
Walkthrough to implement the Health Monitoring
Library
4. Optional. Define subflows that will be used to ´ping´ external systems.
19
Important: The subflows are in charge of calling external systems
to validate that service is up and running. Those subflows are
defined in our mule application, and they are called from the
health monitoring library through the property “thirdPartyFlows”.
DEMO – Basic Health Monitoring
of Mule Application
21
● http://test-health-monitoring.us-e2.cloudhub.io/api/health/application
● http://test-health-monitoring.us-e2.cloudhub.io/api/health/server
● http://test-health-monitoring.us-e2.cloudhub.io/api/health/thirdParty
● http://test-health-monitoring.us-e2.cloudhub.io/api/health/general
Health Monitoring Endpoints
Questions?
23
● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-variables-context
● https://docs.mulesoft.com/java-module/1.2/java-invoke-method
● https://docs.oracle.com/javase/9/docs/api/java/lang/management/MemoryUsage.html
● https://docs.oracle.com/javase/9/docs/api/java/lang/management/GarbageCollectorMXBean.ht
ml
● https://docs.oracle.com/javase/9/docs/api/java/lang/management/ThreadMXBean.html
● https://github.com/paola-alcval/health-monitoring-library
● https://github.com/paola-alcval/test-health-monitoring
● https://github.com/paola-alcval/test-weather-api
Helpful links
24
Personal email address:
paola.alcval@gmail.com
LinkedIn:
https://www.linkedin.com/in/paola-alcantar-valdes-a74087b3/
Twitter:
@PaoAlcVal
Contact me
Thank you

More Related Content

Similar to Cómo generar e implementar monitoreo para aplicaciones de Mule

What is HTTP Monitor and Why Do You Need It
What is HTTP Monitor and Why Do You Need ItWhat is HTTP Monitor and Why Do You Need It
What is HTTP Monitor and Why Do You Need Itawakish
 
Websphere doctor - your guide to diagnose issues
Websphere doctor - your guide to diagnose issues Websphere doctor - your guide to diagnose issues
Websphere doctor - your guide to diagnose issues Joseph's WebSphere Library
 
Software engineering project guidelines.pptx
Software engineering project guidelines.pptxSoftware engineering project guidelines.pptx
Software engineering project guidelines.pptxsanasaeed84
 
Software engineering project guidelines.pptx
Software engineering project guidelines.pptxSoftware engineering project guidelines.pptx
Software engineering project guidelines.pptxsanasaeed84
 
Abstraction and Automation: A Software Design Approach for Developing Secure ...
Abstraction and Automation: A Software Design Approach for Developing Secure ...Abstraction and Automation: A Software Design Approach for Developing Secure ...
Abstraction and Automation: A Software Design Approach for Developing Secure ...iosrjce
 
beginners-guide-to-observability.pdf
beginners-guide-to-observability.pdfbeginners-guide-to-observability.pdf
beginners-guide-to-observability.pdfValerioArvizzigno1
 
Data Warehouses & Deployment By Ankita dubey
Data Warehouses & Deployment By Ankita dubeyData Warehouses & Deployment By Ankita dubey
Data Warehouses & Deployment By Ankita dubeyAnkita Dubey
 
Srs dispensary-management
Srs dispensary-managementSrs dispensary-management
Srs dispensary-managementStayTuned3
 
Clinic management system
Clinic management systemClinic management system
Clinic management systemMike Taylor
 
IRJET- Application Backup and Restore across Multiple Devices
IRJET-	 Application Backup and Restore across Multiple DevicesIRJET-	 Application Backup and Restore across Multiple Devices
IRJET- Application Backup and Restore across Multiple DevicesIRJET Journal
 
Software Engineering Important Short Question for Exams
Software Engineering Important Short Question for ExamsSoftware Engineering Important Short Question for Exams
Software Engineering Important Short Question for ExamsMuhammadTalha436
 
Google app engine
Google app engineGoogle app engine
Google app engineRenjith318
 
Healthcare Management System for paperless management
Healthcare Management System for paperless managementHealthcare Management System for paperless management
Healthcare Management System for paperless managementMike Taylor
 
Observability vs APM vs Monitoring Comparison
Observability vs APM vs  Monitoring ComparisonObservability vs APM vs  Monitoring Comparison
Observability vs APM vs Monitoring Comparisonjeetendra mandal
 
hospital management system.docx
hospital management system.docxhospital management system.docx
hospital management system.docxNikhil Patil
 
Identifying Software Performance Bottlenecks Using Diagnostic Tools- Impetus ...
Identifying Software Performance Bottlenecks Using Diagnostic Tools- Impetus ...Identifying Software Performance Bottlenecks Using Diagnostic Tools- Impetus ...
Identifying Software Performance Bottlenecks Using Diagnostic Tools- Impetus ...Impetus Technologies
 
Health Prediction System - an Artificial Intelligence Project 2015
Health Prediction System - an Artificial Intelligence Project 2015Health Prediction System - an Artificial Intelligence Project 2015
Health Prediction System - an Artificial Intelligence Project 2015Maruf Abdullah (Rion)
 
PROPOSING AUTOMATED REGRESSION SUITE USING OPEN SOURCE TOOLS FOR A HEALTH CAR...
PROPOSING AUTOMATED REGRESSION SUITE USING OPEN SOURCE TOOLS FOR A HEALTH CAR...PROPOSING AUTOMATED REGRESSION SUITE USING OPEN SOURCE TOOLS FOR A HEALTH CAR...
PROPOSING AUTOMATED REGRESSION SUITE USING OPEN SOURCE TOOLS FOR A HEALTH CAR...ijseajournal
 

Similar to Cómo generar e implementar monitoreo para aplicaciones de Mule (20)

What is HTTP Monitor and Why Do You Need It
What is HTTP Monitor and Why Do You Need ItWhat is HTTP Monitor and Why Do You Need It
What is HTTP Monitor and Why Do You Need It
 
Websphere doctor - your guide to diagnose issues
Websphere doctor - your guide to diagnose issues Websphere doctor - your guide to diagnose issues
Websphere doctor - your guide to diagnose issues
 
Software engineering project guidelines.pptx
Software engineering project guidelines.pptxSoftware engineering project guidelines.pptx
Software engineering project guidelines.pptx
 
Software engineering project guidelines.pptx
Software engineering project guidelines.pptxSoftware engineering project guidelines.pptx
Software engineering project guidelines.pptx
 
J017325660
J017325660J017325660
J017325660
 
Abstraction and Automation: A Software Design Approach for Developing Secure ...
Abstraction and Automation: A Software Design Approach for Developing Secure ...Abstraction and Automation: A Software Design Approach for Developing Secure ...
Abstraction and Automation: A Software Design Approach for Developing Secure ...
 
beginners-guide-to-observability.pdf
beginners-guide-to-observability.pdfbeginners-guide-to-observability.pdf
beginners-guide-to-observability.pdf
 
Data Warehouses & Deployment By Ankita dubey
Data Warehouses & Deployment By Ankita dubeyData Warehouses & Deployment By Ankita dubey
Data Warehouses & Deployment By Ankita dubey
 
Srs dispensary-management
Srs dispensary-managementSrs dispensary-management
Srs dispensary-management
 
Clinic management system
Clinic management systemClinic management system
Clinic management system
 
IRJET- Application Backup and Restore across Multiple Devices
IRJET-	 Application Backup and Restore across Multiple DevicesIRJET-	 Application Backup and Restore across Multiple Devices
IRJET- Application Backup and Restore across Multiple Devices
 
Software Engineering Important Short Question for Exams
Software Engineering Important Short Question for ExamsSoftware Engineering Important Short Question for Exams
Software Engineering Important Short Question for Exams
 
SAD_SDLC.pptx
SAD_SDLC.pptxSAD_SDLC.pptx
SAD_SDLC.pptx
 
Google app engine
Google app engineGoogle app engine
Google app engine
 
Healthcare Management System for paperless management
Healthcare Management System for paperless managementHealthcare Management System for paperless management
Healthcare Management System for paperless management
 
Observability vs APM vs Monitoring Comparison
Observability vs APM vs  Monitoring ComparisonObservability vs APM vs  Monitoring Comparison
Observability vs APM vs Monitoring Comparison
 
hospital management system.docx
hospital management system.docxhospital management system.docx
hospital management system.docx
 
Identifying Software Performance Bottlenecks Using Diagnostic Tools- Impetus ...
Identifying Software Performance Bottlenecks Using Diagnostic Tools- Impetus ...Identifying Software Performance Bottlenecks Using Diagnostic Tools- Impetus ...
Identifying Software Performance Bottlenecks Using Diagnostic Tools- Impetus ...
 
Health Prediction System - an Artificial Intelligence Project 2015
Health Prediction System - an Artificial Intelligence Project 2015Health Prediction System - an Artificial Intelligence Project 2015
Health Prediction System - an Artificial Intelligence Project 2015
 
PROPOSING AUTOMATED REGRESSION SUITE USING OPEN SOURCE TOOLS FOR A HEALTH CAR...
PROPOSING AUTOMATED REGRESSION SUITE USING OPEN SOURCE TOOLS FOR A HEALTH CAR...PROPOSING AUTOMATED REGRESSION SUITE USING OPEN SOURCE TOOLS FOR A HEALTH CAR...
PROPOSING AUTOMATED REGRESSION SUITE USING OPEN SOURCE TOOLS FOR A HEALTH CAR...
 

More from Alexandra N. Martinez

Mejora tu productividad creando aplicaciones de Slack
Mejora tu productividad creando aplicaciones de SlackMejora tu productividad creando aplicaciones de Slack
Mejora tu productividad creando aplicaciones de SlackAlexandra N. Martinez
 
Women Who Mule - Workshop series #2: Ghost
Women Who Mule - Workshop series #2: GhostWomen Who Mule - Workshop series #2: Ghost
Women Who Mule - Workshop series #2: GhostAlexandra N. Martinez
 
Women Who Mule - Workshop series: Create your own blog from scratch without a...
Women Who Mule - Workshop series: Create your own blog from scratch without a...Women Who Mule - Workshop series: Create your own blog from scratch without a...
Women Who Mule - Workshop series: Create your own blog from scratch without a...Alexandra N. Martinez
 
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test RecorderToronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test RecorderAlexandra N. Martinez
 
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-caseToronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-caseAlexandra N. Martinez
 
reCONNECT 2021 May Meetup - Women Who Mule #4
reCONNECT 2021 May Meetup - Women Who Mule #4reCONNECT 2021 May Meetup - Women Who Mule #4
reCONNECT 2021 May Meetup - Women Who Mule #4Alexandra N. Martinez
 
Women Who Mule - April Meetup (Diane Kesler's Journey)
Women Who Mule - April Meetup (Diane Kesler's Journey)Women Who Mule - April Meetup (Diane Kesler's Journey)
Women Who Mule - April Meetup (Diane Kesler's Journey)Alexandra N. Martinez
 
Toronto Virtual Meetup #9 - KPIs and metrics accelerator
Toronto Virtual Meetup #9 - KPIs and metrics acceleratorToronto Virtual Meetup #9 - KPIs and metrics accelerator
Toronto Virtual Meetup #9 - KPIs and metrics acceleratorAlexandra N. Martinez
 
Reviewing a complex dataweave transformation use case v3
Reviewing a complex dataweave transformation use case v3Reviewing a complex dataweave transformation use case v3
Reviewing a complex dataweave transformation use case v3Alexandra N. Martinez
 
What is munit and how to create your first unit test
What is munit and how to create your first unit testWhat is munit and how to create your first unit test
What is munit and how to create your first unit testAlexandra N. Martinez
 
Toronto Virtual Meetup #8 - Tips for Reusability
Toronto Virtual Meetup #8 - Tips for ReusabilityToronto Virtual Meetup #8 - Tips for Reusability
Toronto Virtual Meetup #8 - Tips for ReusabilityAlexandra N. Martinez
 
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)Alexandra N. Martinez
 
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...Alexandra N. Martinez
 
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureToronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureAlexandra N. Martinez
 
Reviewing a Complex DataWeave Transformation Use-case v2
Reviewing a Complex DataWeave Transformation Use-case v2Reviewing a Complex DataWeave Transformation Use-case v2
Reviewing a Complex DataWeave Transformation Use-case v2Alexandra N. Martinez
 
How to use Salesforce composite request connector in Mule
How to use Salesforce composite request connector in MuleHow to use Salesforce composite request connector in Mule
How to use Salesforce composite request connector in MuleAlexandra N. Martinez
 
Meetup en español #4 - MuleSoft para profesionales de Java
 Meetup en español #4 - MuleSoft para profesionales de Java Meetup en español #4 - MuleSoft para profesionales de Java
Meetup en español #4 - MuleSoft para profesionales de JavaAlexandra N. Martinez
 

More from Alexandra N. Martinez (20)

Mejora tu productividad creando aplicaciones de Slack
Mejora tu productividad creando aplicaciones de SlackMejora tu productividad creando aplicaciones de Slack
Mejora tu productividad creando aplicaciones de Slack
 
Women Who Mule - Workshop series #2: Ghost
Women Who Mule - Workshop series #2: GhostWomen Who Mule - Workshop series #2: Ghost
Women Who Mule - Workshop series #2: Ghost
 
Women Who Mule - Workshop series: Create your own blog from scratch without a...
Women Who Mule - Workshop series: Create your own blog from scratch without a...Women Who Mule - Workshop series: Create your own blog from scratch without a...
Women Who Mule - Workshop series: Create your own blog from scratch without a...
 
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test RecorderToronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
Toronto Virtual Meetup #12 - Testing Strategies and MUnit Test Recorder
 
Women Who Mule - June Meetup (EMEA)
Women Who Mule - June Meetup (EMEA)Women Who Mule - June Meetup (EMEA)
Women Who Mule - June Meetup (EMEA)
 
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-caseToronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
Toronto Virtual Meetup #11 - Reviewing Complex DataWeave Transformation Use-case
 
reCONNECT 2021 May Meetup - Women Who Mule #4
reCONNECT 2021 May Meetup - Women Who Mule #4reCONNECT 2021 May Meetup - Women Who Mule #4
reCONNECT 2021 May Meetup - Women Who Mule #4
 
Women Who Mule - April Meetup (Diane Kesler's Journey)
Women Who Mule - April Meetup (Diane Kesler's Journey)Women Who Mule - April Meetup (Diane Kesler's Journey)
Women Who Mule - April Meetup (Diane Kesler's Journey)
 
Toronto Virtual Meetup #9 - KPIs and metrics accelerator
Toronto Virtual Meetup #9 - KPIs and metrics acceleratorToronto Virtual Meetup #9 - KPIs and metrics accelerator
Toronto Virtual Meetup #9 - KPIs and metrics accelerator
 
Reviewing a complex dataweave transformation use case v3
Reviewing a complex dataweave transformation use case v3Reviewing a complex dataweave transformation use case v3
Reviewing a complex dataweave transformation use case v3
 
Introduction to MuleSoft
Introduction to MuleSoftIntroduction to MuleSoft
Introduction to MuleSoft
 
What is munit and how to create your first unit test
What is munit and how to create your first unit testWhat is munit and how to create your first unit test
What is munit and how to create your first unit test
 
Truly Human part 1
Truly Human part 1Truly Human part 1
Truly Human part 1
 
Toronto Virtual Meetup #8 - Tips for Reusability
Toronto Virtual Meetup #8 - Tips for ReusabilityToronto Virtual Meetup #8 - Tips for Reusability
Toronto Virtual Meetup #8 - Tips for Reusability
 
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
Meetup en español #6 - MuleSoft para profesionales de Java (segunda edición)
 
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
Meetup en español #5 - Continuous Integration and Continuous Delivery (CI/CD)...
 
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB ArchitectureToronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
Toronto Virtual Meetup #7 - Anypoint VPC, VPN and DLB Architecture
 
Reviewing a Complex DataWeave Transformation Use-case v2
Reviewing a Complex DataWeave Transformation Use-case v2Reviewing a Complex DataWeave Transformation Use-case v2
Reviewing a Complex DataWeave Transformation Use-case v2
 
How to use Salesforce composite request connector in Mule
How to use Salesforce composite request connector in MuleHow to use Salesforce composite request connector in Mule
How to use Salesforce composite request connector in Mule
 
Meetup en español #4 - MuleSoft para profesionales de Java
 Meetup en español #4 - MuleSoft para profesionales de Java Meetup en español #4 - MuleSoft para profesionales de Java
Meetup en español #4 - MuleSoft para profesionales de Java
 

Recently uploaded

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 

Recently uploaded (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 

Cómo generar e implementar monitoreo para aplicaciones de Mule

  • 1. May 26th, 2021 ¿Cómo generar e implementar monitoreo para aplicaciones de Mule? Paola Alcantar Valdes
  • 2. 2 ● About me ● What is a Health Monitoring ● Importance of implementing a Health Monitoring ● Health Monitoring application objectives ● Application metricts to watch ● Building a basic Health Monitoring for Mule Application ● How to implement a Health Monitoring Library in a Mule Application ● DEMO – Basic Health Monitoring for Mule Application ● Questions Agenda
  • 3. 3 ●Paola Alcantar Valdes ○ Jr. Integration Engineer with Mulesoft at Twitter ○ Mulesoft Certified Developer – Level 1 (Mule 4) ○ Over two years of experience as a Managed Services About me
  • 4. Importance of implementing a health monitoring What is a Health Monitoring?
  • 5. 5 ● What is a Health Monitoring? ○ It is an application that continually checks the status of an integration that is running. ● Differences between Application Health Monitoring and Application Health Checks: ○ Application Health Monitoring: ○ It is a good practice that allows collecting key metrics about different aspects of an application to watch how it's working over time. ○ Application Health Checks: ○ Definition of “healthy” parameters based on regular checks information to ensure the system is working the way it’s expected to. ○ Based on a business logic criteria, this should not be just “black“ or “white“ Health Monitoring
  • 6. 6 ● Importance of implementing a Health Monitoring: ○ It allows you to detect issues before they become complete outages. It will help you to detect incidents before they affect customers. ○ Building and implementing a health monitoring application will help you create an action plan if an incident does pop up. ○ A health monitoring application will allow helping you to understand better the behavior of applications, servers, external systems. Also, to close visibility and performance gaps, correct processes, and ensure you're getting total value from your applications. Health Monitoring
  • 7. Application metricts to watch Health Monitoring application objectives
  • 8. 8 ● There is no single way to build health monitoring for your applications. It is why different IT teams will have different perspectives about the thing you need to care about. However, a basic and useful health monitoring application might consider the following aspects. ○ Application’s general information: Get application name, application version, application environment, mule runtime version, etc. ○ Memory Information: Get Heap Memory, Non-Heap Memory, Garbage Collection information from JVM. ○ Thread information: Return the number of demon threads, non-demon threads, and peak threads. ○ Overall availability (External systems): Retrieve the status of the external system with which the application interacts (Know if external systems are up-and-running or not). Health Monitoring application objectives
  • 9. 9 ● Application’s general information: Health Monitoring application objectives %dw 2.0 output application/json --- { apiName: app.name, apiVersion: p("apiVersion") default "", env: p("env") default "", runtimeVersion: mule.version, startDate: ((app.muleContext.startDate default now()) as DateTime {unit: "milliseconds"}), timeZone: server.timeZone, traceId: correlationId, }
  • 10. 10 ● Memory Information : Health Monitoring application objectives public static void heapMemoryDetails() { MemoryMXBean memBean = ManagementFactory.getMemoryMXBean() ; MemoryUsage heapMemoryUsage = memBean.getHeapMemoryUsage(); long heapInitSize = heapMemoryUsage.getInit(); long heapUsedSize = heapMemoryUsage.getUsed(); long heapCommitedSize = heapMemoryUsage.getCommitted(); long heapMaxSize = heapMemoryUsage.getMax(); }
  • 11. 11 ● Garbage Collection Information : Health Monitoring application objectives public static ArrayList<GarbageCollection> garbageCollection(){ ArrayList<GarbageCollectorMXBean> memBean = (ArrayList<GarbageCollectorMXBean>) ManagementFactory.getGarbageCollectorMXBeans(); ArrayList<GarbageCollection> gc = new ArrayList<GarbageCollection>(); for (GarbageCollectorMXBean garbageCollectorMXBean : memBean) { gc.add(new GarbageCollection(garbageCollectorMXBean.getName(), garbageCollectorMXBean.getCollectionCount(), garbageCollectorMXBean.getCollectionTime())); } return gc; }
  • 12. 12 ● Thread information : Health Monitoring application objectives public static void threadInformation() { int demonThreads = ManagementFactory.getThreadMXBean().getDaemonThreadCount(); int peakThreads = ManagementFactory.getThreadMXBean().getPeakThreadCount(); int threadCount = ManagementFactory.getThreadMXBean().getThreadCount(); long startedThreadCount = ManagementFactory.getThreadMXBean().getTotalStartedThreadCount(); }
  • 13. Building a basic Health Monitoring for Mule Application
  • 14. 14 1. Create a Mule 4 application. 2. Update the pom.xml file to define the “classifier” of the mule application as a “mule-plugin”. 3. Define the endpoints for the health monitoring library in a RAML Definition file. For example: ○ /health/application ○ /health/server ○ /health/thirdParty ○ /health/general Walkthrough: How to build a Health Monitoring for Mule Applications See Health Monitoring RAML Definition File
  • 15. 15 4. Define the response for each endpoint. 5. Generate Flows based on RAML Definition file. 6. Remove auto-generated HTTP Configuration. 7. Set “config-ref” value on HTTP Listener Configuration with “${health.http.config}” Walkthrough: How to build a Health Monitoring for Mule Applications See Health Monitoring application objectives Note: Value of “health.http.config” property will be defined in each mule application that implements health monitoring library.
  • 16. 16 8. Get objective keys related to each endpoint. 9. Generate dataweave scripts to format endpoint responses. For example: 10. Install our health monitoring plugin into a repository using command mvn clean install. 11. Implement health monitoring library following next steps. Walkthrough: How to build a Health Monitoring for Mule Applications See Health Monitoring RAML Definition File %dw 2.0 output application/json --- { apiName: app.name, apiVersion: p("apiVersion") default "", env: p("env") default "", runtimeVersion: mule.version, startDate: ((app.muleContext.startDate default now()) as DateTime {unit: "milliseconds"}), timeZone: server.timeZone, traceId: correlationId, }
  • 17. How to implement a Health Monitoring Library in a Mule Application
  • 18. Walkthrough: How to implement a Health Monitoring Library 1. Add the Health Monitoring library dependency to our mule application pom.xml file. 2. Import into our mule application the mule configuration files from the library. 3. Define the following properties into our mule application. The thirdPartyFlows property is optional and does not need to be defined. 18
  • 19. Walkthrough to implement the Health Monitoring Library 4. Optional. Define subflows that will be used to ´ping´ external systems. 19 Important: The subflows are in charge of calling external systems to validate that service is up and running. Those subflows are defined in our mule application, and they are called from the health monitoring library through the property “thirdPartyFlows”.
  • 20. DEMO – Basic Health Monitoring of Mule Application
  • 21. 21 ● http://test-health-monitoring.us-e2.cloudhub.io/api/health/application ● http://test-health-monitoring.us-e2.cloudhub.io/api/health/server ● http://test-health-monitoring.us-e2.cloudhub.io/api/health/thirdParty ● http://test-health-monitoring.us-e2.cloudhub.io/api/health/general Health Monitoring Endpoints
  • 23. 23 ● https://docs.mulesoft.com/mule-runtime/4.3/dataweave-variables-context ● https://docs.mulesoft.com/java-module/1.2/java-invoke-method ● https://docs.oracle.com/javase/9/docs/api/java/lang/management/MemoryUsage.html ● https://docs.oracle.com/javase/9/docs/api/java/lang/management/GarbageCollectorMXBean.ht ml ● https://docs.oracle.com/javase/9/docs/api/java/lang/management/ThreadMXBean.html ● https://github.com/paola-alcval/health-monitoring-library ● https://github.com/paola-alcval/test-health-monitoring ● https://github.com/paola-alcval/test-weather-api Helpful links