Hi Carsten,
thinking more about it, HealthCheckResultCache is not the best place for
it... the monitor can be already configured to log results via config
"logResults" [1] (impl [2]), to achieve what you are after the enum [2]
could be extended for a value STATUS_CHANGES_OR_NOT_OK. The advantage is
that this can be configured more fine-granular per monitor, also non-ok
status values are logged as WARN. Would that also work for you?
-Georg
[1]
https://github.com/apache/felix-dev/tree/master/healthcheck#setting-up-a-monitor-configuration
[2]
https://github.com/apache/felix-dev/blob/3e5671ae7e5107f4f849ef9d5f0a89b1ba9d7439/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/monitor/HealthCheckMonitor.java#L280
[3]
https://github.com/apache/felix-dev/blob/3e5671ae7e5107f4f849ef9d5f0a89b1ba9d7439/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/monitor/HealthCheckMonitor.java#L280-L315
On 2021-12-07 14:00, Carsten Ziegeler wrote:
Hi,
I think we should only compare toString() if the status is not OK (old
and new). If a HC is not in the OK state, it is very useful to see
changes in the state via toString()
Regards
Carsten
Am 07.12.2021 um 13:16 schrieb Georg Henzler:
Hi Carsten,
I just came across the logging change [1]/[2] you made some time ago -
due to the fact that it also compares the toString()-representations
of the checks [3] there is a lot of noise in the log file, e.g. in my
example [4] below for the memory check that remains on the same status
but slightly changes the used memory numbers.
Would it make sense to only compare the status and for the case the
status changes, log the previous and current entry but avoid logging
toString()-changes?
(assuming that memory monitoring for graphs etc. happens in an
external system)
-Georg
[1] https://issues.apache.org/jira/browse/FELIX-6447
[2]
https://github.com/apache/felix-dev/commit/337d2add5f7aefbd73633f77219cc11cb3931ac7
[3]
https://github.com/apache/felix-dev/blob/337d2add5f7aefbd73633f77219cc11cb3931ac7/healthcheck/core/src/main/java/org/apache/felix/hc/core/impl/executor/HealthCheckResultCache.java#L58
[4]
07.12.2021 12:41:10.877 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 440,1MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 649,9MB, INFO Memory Usage: 21,2% of 3,0GB maximal heap
used]]
07.12.2021 12:41:15.879 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 415,5MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 674,5MB, INFO Memory Usage: 22,0% of 3,0GB maximal heap
used]]
07.12.2021 12:41:15.879 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 415,3MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 674,7MB, INFO Memory Usage: 22,0% of 3,0GB maximal heap
used]]
07.12.2021 12:41:20.875 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 391,7MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 698,3MB, INFO Memory Usage: 22,7% of 3,0GB maximal heap
used]]
07.12.2021 12:41:20.875 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 391,4MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 698,6MB, INFO Memory Usage: 22,7% of 3,0GB maximal heap
used]]
07.12.2021 12:41:25.877 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 365,1MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 724,9MB, INFO Memory Usage: 23,6% of 3,0GB maximal heap
used]]
07.12.2021 12:41:25.877 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 364,7MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 725,3MB, INFO Memory Usage: 23,6% of 3,0GB maximal heap
used]]
07.12.2021 12:41:30.875 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 343,4MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 746,6MB, INFO Memory Usage: 24,3% of 3,0GB maximal heap
used]]
07.12.2021 12:41:30.875 *INFO* [HealthCheck Memory]
org.apache.felix.hc.core.impl.executor.HealthCheckResultCache Updating
HC result for Memory : Result [status=OK, resultLog=ResultLog: [DEBUG
Free memory: 343,2MB, DEBUG Currently allocated memory: 1,1GB, DEBUG
Used memory: 746,8MB, INFO Memory Usage: 24,3% of 3,0GB maximal heap
used]]