From 12a433f33210e48135edd93bbc39912adfe20bdb Mon Sep 17 00:00:00 2001 From: Sumeet Chawla Date: Wed, 16 Aug 2023 19:54:51 +0530 Subject: [PATCH 1/3] Set osStats in jvmStats --- src/main/java/com/avioconsulting/mule/health/JvmInfo.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/avioconsulting/mule/health/JvmInfo.java b/src/main/java/com/avioconsulting/mule/health/JvmInfo.java index 72fa14f..d175baa 100644 --- a/src/main/java/com/avioconsulting/mule/health/JvmInfo.java +++ b/src/main/java/com/avioconsulting/mule/health/JvmInfo.java @@ -5,6 +5,7 @@ import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; import java.lang.management.MemoryUsage; +import java.lang.management.RuntimeMXBean; import java.lang.management.ThreadMXBean; import java.lang.management.GarbageCollectorMXBean; import com.sun.management.OperatingSystemMXBean; @@ -59,6 +60,9 @@ public static JvmStats getJvmStats() throws Exception { stats.setMemoryStats(memStats); stats.setThreadStats(threadStats); stats.setGarbageCollectionStats(gcStats); + + OSStats osStats = getOsStats(); + stats.setOsStats(osStats); return stats; From 35c7ef14ca1ff7f7ad92b7eefbcc6de581cc82e2 Mon Sep 17 00:00:00 2001 From: Sumeet Chawla Date: Wed, 16 Aug 2023 19:57:00 +0530 Subject: [PATCH 2/3] replace vars.correlationId with correlationId as the variable is not set by the property file. There were 2 possible fixes 1) to add property to the module and then have caller pass the correlationId or 2) To use the build-in variable. Choose the later option so the fix work for existing users. --- src/main/mule/health-check-api.xml | 32 +++++++++---------- .../smart/connector/module-health check.xml | 32 +++++++++---------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/main/mule/health-check-api.xml b/src/main/mule/health-check-api.xml index c93a337..b375079 100644 --- a/src/main/mule/health-check-api.xml +++ b/src/main/mule/health-check-api.xml @@ -42,7 +42,7 @@ http://www.mulesoft.org/schema/mule/api-gateway http://www.mulesoft.org/schema/m doc:name="Log Start" doc:id="1c37691b-e1c5-4bfa-be28-f53fa55f289f" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start Processing Request for /health endpoint" level="DEBUG"/> doc:name="Log End" doc:id="8917e3f9-5437-4cf7-ae77-648a8010e34e" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Completed Processing Request for /health endpoint" level="DEBUG"/> - + @@ -118,7 +118,7 @@ vars.appStats.systemStatus]]> doc:name="Log Start" doc:id="3e2cfb8b-56e2-44e7-8d31-d63d10993df4" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start Processing Request for health/app health Check endpoint" level="DEBUG"/> doc:name="Log End" doc:id="29a6964e-b026-46fb-b155-ae8f7e419ccb" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Completed Processing Request for health/app health Check endpoint" level="DEBUG"/> doc:name="Log Error" doc:id="208d8ab3-ed2b-4bf9-a3e8-a1b99b206a3d" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Error Processing Request for /health/app endpoint" level="ERROR" payload='#[write(payload,"application/json")]' @@ -194,7 +194,7 @@ vars.appStats.systemStatus]]> doc:name="Log Start" doc:id="6cb1794f-1844-40c2-a9d4-ad954467da78" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start Processing Request for /health/runtime health Check endpoint" level="DEBUG"/> doc:name="Log End" doc:id="3234da30-98a1-4b34-acfc-3b5a69961528" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Completed Processing Request for /health/runtime health Check endpoint" level="DEBUG"/> doc:name="Log Error" doc:id="649f7463-3d1c-485a-9ce3-f6f5e1e2e623" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Error Processing Request for /health/runtime endpoint" level="ERROR" payload='#[write(payload,"application/json")]' @@ -275,7 +275,7 @@ vars.jvmInfo]]> doc:name="Log Start" doc:id="b13b7260-e265-491d-8a16-f2343b3aa9e6" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start processing request for Runtime Stats SubFlow" level="DEBUG"/> @@ -439,7 +439,7 @@ output application/java doc:name="Log Start" doc:id="bbaa04ba-15fd-4693-807d-091b79abada7" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start Processing request for app-stats-flows" level="DEBUG"/> diff --git a/src/main/resources/org/mule/extensions/smart/connector/module-health check.xml b/src/main/resources/org/mule/extensions/smart/connector/module-health check.xml index 3cda1b8..f97c825 100644 --- a/src/main/resources/org/mule/extensions/smart/connector/module-health check.xml +++ b/src/main/resources/org/mule/extensions/smart/connector/module-health check.xml @@ -55,7 +55,7 @@ doc:name="Log Start" doc:id="1c37691b-e1c5-4bfa-be28-f53fa55f289f" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start Processing Request for /health endpoint" level="DEBUG"/> doc:name="Log End" doc:id="8917e3f9-5437-4cf7-ae77-648a8010e34e" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Completed Processing Request for /health endpoint" level="DEBUG"/> - + @@ -131,7 +131,7 @@ vars.appStats.systemStatus]]> doc:name="Log Start" doc:id="3e2cfb8b-56e2-44e7-8d31-d63d10993df4" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start Processing Request for health/app health Check endpoint" level="DEBUG"/> doc:name="Log End" doc:id="29a6964e-b026-46fb-b155-ae8f7e419ccb" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Completed Processing Request for health/app health Check endpoint" level="DEBUG"/> doc:name="Log Error" doc:id="208d8ab3-ed2b-4bf9-a3e8-a1b99b206a3d" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Error Processing Request for /health/app endpoint" level="ERROR" payload='#[write(payload,"application/json")]' @@ -207,7 +207,7 @@ vars.appStats.systemStatus]]> doc:name="Log Start" doc:id="6cb1794f-1844-40c2-a9d4-ad954467da78" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start Processing Request for /health/runtime health Check endpoint" level="DEBUG"/> doc:name="Log End" doc:id="3234da30-98a1-4b34-acfc-3b5a69961528" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Completed Processing Request for /health/runtime health Check endpoint" level="DEBUG"/> doc:name="Log Error" doc:id="649f7463-3d1c-485a-9ce3-f6f5e1e2e623" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Error Processing Request for /health/runtime endpoint" level="ERROR" payload='#[write(payload,"application/json")]' @@ -288,7 +288,7 @@ vars.jvmInfo]]> doc:name="Log Start" doc:id="b13b7260-e265-491d-8a16-f2343b3aa9e6" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start processing request for Runtime Stats SubFlow" level="DEBUG"/> @@ -452,7 +452,7 @@ output application/java doc:name="Log Start" doc:id="bbaa04ba-15fd-4693-807d-091b79abada7" config-ref="Health_Check_Logger_Config" - correlationId="#[vars.correlationId]" + correlationId="#[correlationId]" message="Start Processing request for app-stats-flows" level="DEBUG"/> From 24c24d631cf4384ebcd424f9d9f0549d18eb9a60 Mon Sep 17 00:00:00 2001 From: Sumeet Chawla Date: Tue, 19 Nov 2024 13:43:21 +0530 Subject: [PATCH 3/3] remove health-check-api.xml --- src/main/mule/health-check-api.xml | 582 ----------------------------- 1 file changed, 582 deletions(-) delete mode 100644 src/main/mule/health-check-api.xml diff --git a/src/main/mule/health-check-api.xml b/src/main/mule/health-check-api.xml deleted file mode 100644 index b375079..0000000 --- a/src/main/mule/health-check-api.xml +++ /dev/null @@ -1,582 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { - "gcName": garbageCollector.gcName, - "collectionCount": garbageCollector.collectionCount, - "collectionTime": garbageCollector.collectionTime - } -}]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - item.status=="OK")) < total) (500) else (200) -}]]> - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file