Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove returning error message when ObserverContext is null while adding tags to Metrics #89

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
org = "ballerina"
name = "observe"
version = "1.2.1"
version = "1.2.2"
distribution = "2201.8.0"
export = ["observe", "observe.mockextension" ]

[platform.java17]
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"

Expand Down
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ modules = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.2.1"
version = "1.2.2"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
Loading