Skip to content
Merged
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
8 changes: 3 additions & 5 deletions ballerina/root_logger.bal
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,9 @@ isolated class RootLogger {
logRecord[k] = v;
}
}
if observe:isObservabilityEnabled() {
string? runtimeId = observe:getTagValue(ICP_RUNTIME_ID_KEY);
if runtimeId is string {
logRecord[ICP_RUNTIME_ID_KEY] = runtimeId;
}
string? runtimeId = observe:getTagValue(ICP_RUNTIME_ID_KEY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without observability enabled, do we get this tag value? If so why the tag is exposed in observe API instead of a runtime API?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that isObservabilityEnabled() check becomes true only if any observability provider is set. Otherwise, it remains false even if we have enabled observability in Ballerina.toml

if runtimeId is string {
logRecord[ICP_RUNTIME_ID_KEY] = runtimeId;
}

foreach [string, Value] [k, v] in self.keyValues.entries() {
Expand Down