From 080786d6ac14fcbd80976ad80f87777c39bb0a0d Mon Sep 17 00:00:00 2001 From: Gaurav Shah Date: Mon, 27 Nov 2023 23:49:50 +0530 Subject: [PATCH] added code to check micrometer metrics for non mendix cloud --- buildpack/telemetry/metrics.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/buildpack/telemetry/metrics.py b/buildpack/telemetry/metrics.py index d8bc8268..5520a596 100644 --- a/buildpack/telemetry/metrics.py +++ b/buildpack/telemetry/metrics.py @@ -108,9 +108,18 @@ def _micrometer_runtime_requirement(runtime_version): def micrometer_metrics_enabled(runtime_version): """Check for metrics from micrometer.""" - return bool(get_micrometer_metrics_url()) and _micrometer_runtime_requirement( - runtime_version - ) + logging.info("checking is micrometer metrics enabled") + micrometer_enabled=False + if(_micrometer_runtime_requirement(runtime_version)) + logging.info("satisfies micrometer runtime requirement") + if(bool(get_micrometer_metrics_url())) + logging.info("Found micrometer metrics url configured") + micrometer_enabled = True + elif(strtobool(os.getenv("NON_MENDIX_PUBLIC_CLOUD","false"))) + logging.info("micrometer for non mendix public cloud") + micrometer_enabled = True + return micrometer_enabled + def configure_metrics_registry(m2ee):