From 4b3174657628b564cc5a69b048f6be49e4897bbc Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Thu, 21 Nov 2024 14:13:26 +0530 Subject: [PATCH] Define metric log function name --- .../stdlib/observe/observers/BallerinaMetricsLogsObserver.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/native/src/main/java/io/ballerina/stdlib/observe/observers/BallerinaMetricsLogsObserver.java b/native/src/main/java/io/ballerina/stdlib/observe/observers/BallerinaMetricsLogsObserver.java index 6053b78..f4a0ab1 100644 --- a/native/src/main/java/io/ballerina/stdlib/observe/observers/BallerinaMetricsLogsObserver.java +++ b/native/src/main/java/io/ballerina/stdlib/observe/observers/BallerinaMetricsLogsObserver.java @@ -38,6 +38,7 @@ public class BallerinaMetricsLogsObserver implements BallerinaObserver { private static final String ORG_NAME = "ballerinax"; + private static final String METRIC_LOG_FUNCTION_NAME = "printMetricsLog"; private static final String PROPERTY_START_TIME = "_observation_start_time_"; private static final PrintStream consoleError = System.err; @@ -121,6 +122,6 @@ private void handleError(String metricName, Set tags, RuntimeException e) { private static void printMetricLog(BMap logAttributes) { // TODO: Remove version when the API is finalized, and add the configured org name. Module metricsLogsModule = new Module(ORG_NAME, ObserveUtils.getMetricsLogsProvider().getValue(), "1"); - environment.getRuntime().callFunction(metricsLogsModule, "printMetricsLog", null, logAttributes); + environment.getRuntime().callFunction(metricsLogsModule, METRIC_LOG_FUNCTION_NAME, null, logAttributes); } }