SAP / cf-java-logging-support

The Java Logging Support for Cloud Foundry supports the creation of structured log messages and the collection of request metrics
Apache License 2.0
77 stars 48 forks source link

Services using Custom metrics is not usable with all type of bindings #152

Open dimitarKiryakov opened 1 year ago

dimitarKiryakov commented 1 year ago

Hello Colleagues, Currently, the feature of https://github.com/SAP/cf-java-logging-support#custom-metrics is very usable. Unfortunately due to this condition here: https://github.com/SAP/cf-java-logging-support/blob/master/cf-java-monitoring-custom-metrics-clients/cf-custom-metrics-clients-spring-boot/src/main/java/com/sap/cloud/cf/monitoring/spring/configuration/CustomMetricsCondition.java

service that does not use application-logging could not benefit from it. Please remove this condition in order for custom drainers for example([redacted]) to benefit from it in CF.

There is a workaround to predefine the autoconfigure annotation but it is a very ugly one.

KarstenSchnitter commented 1 year ago

Hi,

thanks for reaching out. The support for custom metrics is highly specific to the SAP BTP Application Logging Service, where there is matching parsing in place. It is not intended to be used in other context, where superior solutions exist. These could e.g. be a metrics registry for Spring Boot, a Prometheus endpoint or additional instrumentation with OpenTelemetry. The custom metrics modules of cf-java-logging-support should not be used for these use-cases.

Best Regards, Karsten