From ec729fdf21ac559657b863ed8301cf2e25ccffac Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Mon, 18 Nov 2024 18:46:15 +0530 Subject: [PATCH 1/6] [Automated] Update the native jar versions --- ballerina/Dependencies.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index a432a49..cae6654 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.10.0" +distribution-version = "2201.11.0-SNAPSHOT" [[package]] org = "ballerina" From d646d6e668a6f30f5438f70156dbe0bb13326e43 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Tue, 19 Nov 2024 21:53:07 +0530 Subject: [PATCH 2/6] Add metrics logs provider configuration --- ballerina/commons.bal | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/ballerina/commons.bal b/ballerina/commons.bal index be73c21..9bfb302 100644 --- a/ballerina/commons.bal +++ b/ballerina/commons.bal @@ -24,11 +24,13 @@ configurable string metricsReporter = ""; configurable boolean tracingEnabled = false; configurable string tracingProvider = ""; configurable boolean metricsLogsEnabled = false; +configurable string metricsLogsProvider = ""; function init() returns error? { boolean isMissingMetricsReporter = ((enabled || metricsEnabled) && (provider == "" && metricsReporter == "")); boolean isMissingTracingProvider = ((enabled || tracingEnabled) && (provider == "" && tracingProvider == "")); - if (isMissingMetricsReporter || isMissingTracingProvider) { + boolean isMissingMetricsLogsProvider = ((enabled || metricsLogsEnabled) && (provider == "" && metricsLogsProvider == "")); + if (isMissingMetricsReporter || isMissingTracingProvider || isMissingMetricsLogsProvider) { string[] enabledObservers = []; string[] missingProviders = []; if (isMissingMetricsReporter) { @@ -39,6 +41,10 @@ function init() returns error? { enabledObservers.push("tracing"); missingProviders.push("tracing provider"); } + if (isMissingMetricsLogsProvider) { + enabledObservers.push("metrics logs"); + missingProviders.push("metrics logs provider"); + } return error("Observability (" + " and ".join(...enabledObservers) + ") enabled without " + " and ".join(...missingProviders) + ". Please visit https://central.ballerina.io/ballerina/observe for " + "the list of officially supported Observability providers."); @@ -61,6 +67,13 @@ public isolated function isMetricsEnabled() returns boolean = @java:Method { 'class: "io.ballerina.runtime.observability.ObserveUtils" } external; +# Check whether metrics logs is enabled. +# + return - metrics enabled/disabled. +public isolated function isMetricsLogsEnabled() returns boolean = @java:Method { + name: "isMetricsLogsEnabled", + 'class: "io.ballerina.runtime.observability.ObserveUtils" +} external; + # Retrieve metrics provider. # + return - metrics provider. public isolated function getMetricsProvider() returns string = @java:Method { @@ -68,6 +81,13 @@ public isolated function getMetricsProvider() returns string = @java:Method { 'class: "io.ballerina.runtime.observability.ObserveUtils" } external; +# Retrieve metrics logs provider. +# + return - metrics logs provider. +public isolated function getMetricsLogsProvider() returns string = @java:Method { + name: "getMetricsLogsProvider", + 'class: "io.ballerina.runtime.observability.ObserveUtils" +} external; + # Retrieve metrics reporter. # + return - metrics reporter. public isolated function getMetricsReporter() returns string = @java:Method { From 320ab151dde0e04688b576bd963e4dca68c2af84 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Fri, 22 Nov 2024 10:04:28 +0530 Subject: [PATCH 3/6] Remove metricsLogsProvider config --- ballerina/commons.bal | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/ballerina/commons.bal b/ballerina/commons.bal index 9bfb302..5cbc5b7 100644 --- a/ballerina/commons.bal +++ b/ballerina/commons.bal @@ -24,13 +24,11 @@ configurable string metricsReporter = ""; configurable boolean tracingEnabled = false; configurable string tracingProvider = ""; configurable boolean metricsLogsEnabled = false; -configurable string metricsLogsProvider = ""; function init() returns error? { boolean isMissingMetricsReporter = ((enabled || metricsEnabled) && (provider == "" && metricsReporter == "")); boolean isMissingTracingProvider = ((enabled || tracingEnabled) && (provider == "" && tracingProvider == "")); - boolean isMissingMetricsLogsProvider = ((enabled || metricsLogsEnabled) && (provider == "" && metricsLogsProvider == "")); - if (isMissingMetricsReporter || isMissingTracingProvider || isMissingMetricsLogsProvider) { + if (isMissingMetricsReporter || isMissingTracingProvider) { string[] enabledObservers = []; string[] missingProviders = []; if (isMissingMetricsReporter) { @@ -41,10 +39,6 @@ function init() returns error? { enabledObservers.push("tracing"); missingProviders.push("tracing provider"); } - if (isMissingMetricsLogsProvider) { - enabledObservers.push("metrics logs"); - missingProviders.push("metrics logs provider"); - } return error("Observability (" + " and ".join(...enabledObservers) + ") enabled without " + " and ".join(...missingProviders) + ". Please visit https://central.ballerina.io/ballerina/observe for " + "the list of officially supported Observability providers."); @@ -81,13 +75,6 @@ public isolated function getMetricsProvider() returns string = @java:Method { 'class: "io.ballerina.runtime.observability.ObserveUtils" } external; -# Retrieve metrics logs provider. -# + return - metrics logs provider. -public isolated function getMetricsLogsProvider() returns string = @java:Method { - name: "getMetricsLogsProvider", - 'class: "io.ballerina.runtime.observability.ObserveUtils" -} external; - # Retrieve metrics reporter. # + return - metrics reporter. public isolated function getMetricsReporter() returns string = @java:Method { From fb65a034573ced3db94fd414bb913cc574be6890 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Fri, 22 Nov 2024 15:08:34 +0530 Subject: [PATCH 4/6] Update check for provider configs --- ballerina/commons.bal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ballerina/commons.bal b/ballerina/commons.bal index 5cbc5b7..16ead05 100644 --- a/ballerina/commons.bal +++ b/ballerina/commons.bal @@ -28,7 +28,8 @@ configurable boolean metricsLogsEnabled = false; function init() returns error? { boolean isMissingMetricsReporter = ((enabled || metricsEnabled) && (provider == "" && metricsReporter == "")); boolean isMissingTracingProvider = ((enabled || tracingEnabled) && (provider == "" && tracingProvider == "")); - if (isMissingMetricsReporter || isMissingTracingProvider) { + boolean isMissingMetricsLogsProvider = enabled || metricsLogsEnabled; + if (isMissingMetricsReporter || isMissingTracingProvider || isMissingMetricsLogsProvider) { string[] enabledObservers = []; string[] missingProviders = []; if (isMissingMetricsReporter) { From 4d6785a9ee4b7fed7fc4a5f66324eaa34ef8fbd8 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Thu, 28 Nov 2024 10:04:53 +0530 Subject: [PATCH 5/6] Remove checking metrics logs provider --- ballerina/commons.bal | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ballerina/commons.bal b/ballerina/commons.bal index 16ead05..5cbc5b7 100644 --- a/ballerina/commons.bal +++ b/ballerina/commons.bal @@ -28,8 +28,7 @@ configurable boolean metricsLogsEnabled = false; function init() returns error? { boolean isMissingMetricsReporter = ((enabled || metricsEnabled) && (provider == "" && metricsReporter == "")); boolean isMissingTracingProvider = ((enabled || tracingEnabled) && (provider == "" && tracingProvider == "")); - boolean isMissingMetricsLogsProvider = enabled || metricsLogsEnabled; - if (isMissingMetricsReporter || isMissingTracingProvider || isMissingMetricsLogsProvider) { + if (isMissingMetricsReporter || isMissingTracingProvider) { string[] enabledObservers = []; string[] missingProviders = []; if (isMissingMetricsReporter) { From 6725f65a62389c36e24109a15da103631f3d8817 Mon Sep 17 00:00:00 2001 From: NipunaMadhushan Date: Thu, 19 Dec 2024 15:18:03 +0530 Subject: [PATCH 6/6] Update lang version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 65acb13..ccc2955 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,7 +15,7 @@ org.gradle.caching=true group=io.ballerina.stdlib version=1.4.0-SNAPSHOT -ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 +ballerinaLangVersion=2201.11.0-20241219-143200-53f6d83e githubSpotbugsVersion=6.0.18 githubJohnrengelmanShadowVersion=8.1.1 underCouchDownloadVersion=5.4.0