gcp-o11y: Remove monitored resource detection for logging#10020
Merged
sanjaypujare merged 2 commits intogrpc:masterfrom Apr 6, 2023
Merged
gcp-o11y: Remove monitored resource detection for logging#10020sanjaypujare merged 2 commits intogrpc:masterfrom
sanjaypujare merged 2 commits intogrpc:masterfrom
Conversation
… logging; Delegating the resource detection to cloud logging library instead (enabled by default)
sanjaypujare
reviewed
Apr 6, 2023
| @VisibleForTesting | ||
| static Map<String, String> getCustomTags(Map<String, String> customTags, | ||
| Map<String, String> locationTags, String projectId) { | ||
| static Map<String, String> getCustomTags(Map<String, String> customTags) { |
Contributor
There was a problem hiding this comment.
This function effectively does very little/nothing - handle null on line 172 may be. Can you just replace calls with equivalent logic (handle null)?
Contributor
Author
There was a problem hiding this comment.
The function also creates an immutable map of customTags. On further looking realized null check is not required, as ObservabilityConfigImpl will always return Collections.emptyMap() when custom tags are not set in the configuration.
So I have two options:
- Remove
nullcheck and keep the function as-is to create an immutable map. - Make the method inline and remove
nullcheck i.e
this.customTags = config.getCustomTags();
I prefer Option 1, as it gives us an immutable map. Lmk what you think.
Contributor
There was a problem hiding this comment.
Okay sounds good- option 1 is ok
ejona86
approved these changes
Apr 6, 2023
ejona86
pushed a commit
to ejona86/grpc-java
that referenced
this pull request
Apr 6, 2023
* removed populating monitored resource to k8s_conatiner by default for logging; Delegating the resource detection to cloud logging library instead (enabled by default) * remove kubernetes resource detection logic from observability
ejona86
pushed a commit
that referenced
this pull request
Apr 7, 2023
* removed populating monitored resource to k8s_conatiner by default for logging; Delegating the resource detection to cloud logging library instead (enabled by default) * remove kubernetes resource detection logic from observability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
b/277095016
This PR removes the monitored resource detection for logging (which is only available for kubernetes environments).
By not populating monitored resource, we will leverage cloud logging library's auto population of metadata for monitored resource type and values.