-
Notifications
You must be signed in to change notification settings - Fork 39
feat: implement revised version of the monitored resource type discovery and metadata population #708
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
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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. |
Function env fails because envctl does not support "functions" environment. @daniel-sanche can you help me with checking the reasons for Cloud Run? |
🤖 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).
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
ResourceTypeEnvironmentGetter
class.Implement unit testing of the
MonitoredResourceUtil.getResource()
for each detected environment.Fixes #685