diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index e8eb193..05f9b76 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "observe" -version = "1.2.1" +version = "1.2.2" distribution = "2201.8.0" export = ["observe", "observe.mockextension" ] @@ -9,7 +9,7 @@ export = ["observe", "observe.mockextension" ] graalvmCompatible = true [[platform.java17.dependency]] -path = "../native/build/libs/observe-native-1.2.1.jar" +path = "../native/build/libs/observe-native-1.2.2-SNAPSHOT.jar" groupId = "ballerina" artifactId = "observe" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 7068b88..2725a36 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -18,7 +18,7 @@ modules = [ [[package]] org = "ballerina" name = "observe" -version = "1.2.1" +version = "1.2.2" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] diff --git a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/AddTagToMetrics.java b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/AddTagToMetrics.java index 2becf70..dbaaf4e 100644 --- a/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/AddTagToMetrics.java +++ b/native/src/main/java/io/ballerina/stdlib/observe/nativeimpl/AddTagToMetrics.java @@ -20,8 +20,6 @@ package io.ballerina.stdlib.observe.nativeimpl; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.creators.ErrorCreator; -import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BString; import io.ballerina.runtime.observability.ObserveUtils; import io.ballerina.runtime.observability.ObserverContext; @@ -50,7 +48,8 @@ public static Object addTagToMetrics(Environment env, BString tagKey, BString ta observerContext.customMetricTags.put(tagKey.getValue(), Tag.of(tagKey.getValue(), tagValue.getValue())); return null; } - return ErrorCreator.createError( - StringUtils.fromString("Can not add tag {" + tagKey + ":" + tagValue + "}")); + // ObserverContext will be null if function is executed without entry point like main or resource + // function ex. initialising phase. + return null; } }