test(o11y): add tests for tracing, metrics and logging in java-compute#12730
test(o11y): add tests for tracing, metrics and logging in java-compute#12730diegomarquezp wants to merge 21 commits intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces integration tests for observability "golden signals" (traces, metrics, and logs) in the Compute service. It adds necessary OpenTelemetry and logging dependencies to the POM, implements the ITComputeGoldenSignals test class, and updates CompositeTracer to delegate requestUrlResolved calls. Review feedback identifies an opportunity to prevent test flakiness by clearing the TestAppender state between tests and suggests removing a redundant call to getMDCPropertyMap in the appender's logic.
…mpute-integration-test
Addressed multiple PR comments for naming, constants, and method extraction.
…/github.com/googleapis/google-cloud-java into observability/test/compute-integration-test
…mpute-integration-test
…/github.com/googleapis/google-cloud-java into observability/test/compute-integration-test
| Duration currentDelay = retrySettings.getInitialRetryDelayDuration(); | ||
| com.google.monitoring.v3.TimeSeries targetTs = null; | ||
|
|
||
| while (metricsPollingStopwatch.elapsed().compareTo(retrySettings.getTotalTimeoutDuration()) |
There was a problem hiding this comment.
It seems a little too aggressive to put this in a while loop. Usually how long does it take for the metrics to show up?
| validateMetricsInCloudMonitoring(expectError); | ||
| } | ||
|
|
||
| private void validateLogging(boolean expectError) { |
There was a problem hiding this comment.
Ideally we want to test with Cloud Logging, but I know it is hard to test without a proper exporter, so this is good enough for now.
This PR adds tests for java-compute to confirm behavior of recently added o11y features.
Key changes:
sdk-platform-java/gax-java: OverroderequestUrlResolvedinCompositeTracerto ensureurl.fullis recorded in HTTP/REST transport. This was a fix found during testing.java-compute: IntroducedITComputeGoldenSignals.javato validate tracing, metrics, and logging.java-compute: AddedGOOGLE_SDK_JAVA_LOGGING=trueenvironment variable tomaven-surefire-plugininpom.xmlto enable logging for verification in tests.