This repository was archived by the owner on Feb 6, 2026. It is now read-only.
feat: implement revised version of the monitored resource type discovery and metadata population#708
Merged
feat: implement revised version of the monitored resource type discovery and metadata population#708
Conversation
This was referenced Oct 12, 2021
google-cloud-logging/src/main/java/com/google/cloud/logging/LogEntry.java
Show resolved
Hide resolved
add caching mechanism for results. implement updated heuristics for resource type and labels population.
refactor MonitoredResourceUtil code to allow mocking getenv() and getAttribute(). unit test each resource type with extra test for GAE FE and custom params.
7b5ba22 to
e5dae5a
Compare
simonz130
suggested changes
Oct 13, 2021
simonz130
left a comment
There was a problem hiding this comment.
Very solid PR! Thanks!
We need to ensure that TraceEnhancer is treated correctly for AppEngine cases
google-cloud-logging/src/main/java/com/google/cloud/logging/ResourceTypeEnvironmentGetter.java
Outdated
Show resolved
Hide resolved
google-cloud-logging/src/main/java/com/google/cloud/logging/ResourceTypeEnvironmentGetter.java
Show resolved
Hide resolved
google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java
Show resolved
Hide resolved
google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java
Show resolved
Hide resolved
google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java
Show resolved
Hide resolved
google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java
Show resolved
Hide resolved
google-cloud-logging/src/main/java/com/google/cloud/logging/MonitoredResourceUtil.java
Show resolved
Hide resolved
simonz130
approved these changes
Oct 14, 2021
|
Also note that we have environment tests for Run and Functions failing. Given that this PR adds Functions detection support, worth looking at the env test failure and seeing why is it failing. |
Contributor
Author
|
Function env fails because envctl does not support "functions" environment. @daniel-sanche can you help me with checking the reasons for Cloud Run? |
This was referenced Oct 19, 2021
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Oct 20, 2021
🤖 I have created a release \*beep\* \*boop\* --- ## [3.3.0](https://www.github.com/googleapis/java-logging/compare/v3.2.0...v3.3.0) (2021-10-20) ### Features * implement revised version of the monitored resource type discovery and metadata population ([#708](https://www.github.com/googleapis/java-logging/issues/708)) ([0592c96](https://www.github.com/googleapis/java-logging/commit/0592c96bc697a983f521c7ac51df53661c801975)) ### Dependencies * update dependency com.google.cloud:google-cloud-shared-dependencies to v2.4.0 ([#714](https://www.github.com/googleapis/java-logging/issues/714)) ([6ba9df7](https://www.github.com/googleapis/java-logging/commit/6ba9df7e0f36ea4c41d8bd45a67fa671c41d9db6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.
Implement more robust resource type discovery including support for Cloud Function resource. Cache results per pair of the project id and resource type.
Refactor MonitoredResourceUtil.java to allow mocking static methods that read environment variables and metadata server attributes by using
ResourceTypeEnvironmentGetterclass.Implement unit testing of the
MonitoredResourceUtil.getResource()for each detected environment.Fixes #685