GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(o11y): add tests for tracing, metrics and logging in java-compute by diegomarquezp · Pull Request #12730 · googleapis/google-cloud-java

Conversation

@diegomarquezp

@diegomarquezp diegomarquezp commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

This PR adds tests for java-compute to confirm behavior of recently added o11y features.

Key changes:

  • sdk-platform-java/gax-java: Overrode requestUrlResolved in CompositeTracer to ensure url.full is recorded in HTTP/REST transport. This was a fix found during testing.
  • java-compute: Introduced ITComputeGoldenSignals.java to validate tracing, metrics, and logging.
  • java-compute: Added GOOGLE_SDK_JAVA_LOGGING=true environment variable to maven-surefire-plugin in pom.xml to enable logging for verification in tests.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
diegomarquezp added 3 commits April 9, 2026 10:22
@diegomarquezp
test(o11y): confirm behavior of golden signals in compute
c3f0ca3
@diegomarquezp
chore: fomrat
4ec963c
@diegomarquezp
test: include tests of resource name and url.full
9ad9b35
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Apr 9, 2026
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp added 6 commits April 9, 2026 12:48
@diegomarquezp
test(o11y): fix TestAppender issues in ITComputeGoldenSignals
b86e268
@diegomarquezp
Merge remote-tracking branch 'origin/main' into observability/test/co…
d97cabb
…mpute-integration-test
@diegomarquezp
deps: use current version of google-cloud-trace
03cd5d8
@diegomarquezp
chore: format
bc66f32
@diegomarquezp
chore: remove unused files
b56b010
@diegomarquezp
fix: use correct license header
e810db9
@diegomarquezp
diegomarquezp marked this pull request as ready for review April 9, 2026 19:01
@diegomarquezp
diegomarquezp requested a review from a team as a code owner April 9, 2026 19:01
blakeli0
blakeli0 reviewed Apr 10, 2026
View reviewed changes
Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread sdk-platform-java/gax-java/gax/src/main/java/com/google/api/gax/tracing/CompositeTracer.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@diegomarquezp diegomarquezp mentioned this pull request Apr 10, 2026
fix(o11y): composite tracer to process url changes #12754
Merged
blakeli0 pushed a commit that referenced this pull request Apr 10, 2026
@diegomarquezp
fix(o11y): composite tracer to process url changes (#12754)
70f75bd
Fixes finding from
#12730
diegomarquezp and others added 11 commits April 10, 2026 16:16
@diegomarquezp
Merge branch 'main' into observability/test/compute-integration-test
c5bb9e8
@diegomarquezp
test(compute): refactor golden signals integration test for Prometheus
522b604
Addressed multiple PR comments for naming, constants, and method extraction.
@diegomarquezp
deps(compute): add cloud monitoring dependency
d85fdf6
@diegomarquezp
Merge branch 'observability/test/compute-integration-test' of https:/…
d1fff49
…/github.com/googleapis/google-cloud-java into observability/test/compute-integration-test
@diegomarquezp
test(compute): document rationale for credential refresh in observabi…
0e807a9
…lity tests
@diegomarquezp
chore: format
f0abae6
@diegomarquezp
Merge remote-tracking branch 'origin/main' into observability/test/co…
c6787c5
…mpute-integration-test
@diegomarquezp
deps: update local trace dependecy to current
4cc769c
@cloud-java-bot
chore: generate libraries at Wed Apr 15 17:44:00 UTC 2026
b8f007b
@diegomarquezp
fix: explicit auth scope for CI runs
f2b6e9f
@diegomarquezp
Merge branch 'observability/test/compute-integration-test' of https:/…
8fc4df0
…/github.com/googleapis/google-cloud-java into observability/test/compute-integration-test
blakeli0
blakeli0 reviewed Apr 17, 2026
View reviewed changes
Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Outdated
Duration currentDelay = retrySettings.getInitialRetryDelayDuration();
com.google.monitoring.v3.TimeSeries targetTs = null;

while (metricsPollingStopwatch.elapsed().compareTo(retrySettings.getTotalTimeoutDuration())

@blakeli0 blakeli0 Apr 17, 2026

Copy link
Copy Markdown
Contributor

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.

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?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@diegomarquezp diegomarquezp Apr 20, 2026

Copy link
Copy Markdown
Contributor Author

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.

It takes from 1 to 3 minutes. I modified this to polling every 30 seconds up to 3 minutes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java
validateMetricsInCloudMonitoring(expectError);
}

private void validateLogging(boolean expectError) {

@blakeli0 blakeli0 Apr 17, 2026

Copy link
Copy Markdown
Contributor

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.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@blakeli0
Merge branch 'main' into observability/test/compute-integration-test
d9b66a8
Neenu1995 pushed a commit that referenced this pull request Apr 17, 2026
@diegomarquezp @Neenu1995
fix(o11y): composite tracer to process url changes (#12754)
8a32f81
Fixes finding from
#12730
@diegomarquezp
chore: simplify while loop, make less aggressive
aaea8d7
diegomarquezp added 5 commits April 27, 2026 14:24
@diegomarquezp
chore: Restore test
d4ec6f4
@diegomarquezp
test: increase timeout of trace ITSystemTest
257adbc
@diegomarquezp
chore: Format
79fdd4c
@diegomarquezp
Stabilize logging tests in compute by enabling logging for failsafe a…
15e05be
…nd adding explicit slf4j deps
@diegomarquezp
chore: format
657b218
diegomarquezp
diegomarquezp commented Apr 28, 2026
View reviewed changes
Comment thread java-trace/google-cloud-trace/src/test/java/com/google/cloud/trace/v1/it/ITSystemTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp added 2 commits April 28, 2026 16:32
@diegomarquezp
fix: remove debug logging
e44721f
@diegomarquezp
chore: format
16d4626
diegomarquezp
diegomarquezp commented Apr 29, 2026
View reviewed changes
Comment thread java-compute/google-cloud-compute/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp added 2 commits April 29, 2026 14:39
@diegomarquezp
test: add slf4j 2.x dependency for compute integration tests
b49efa2
@diegomarquezp
chore: fix indentation
aa22260
@diegomarquezp
diegomarquezp force-pushed the observability/test/compute-integration-test branch from 54d637c to aa22260 Compare April 29, 2026 18:39
diegomarquezp added 4 commits April 29, 2026 14:54
@diegomarquezp
build: ignore version in java-compute
a7b6b37
@diegomarquezp
Merge branch 'main' into observability/test/compute-integration-test
05f39e7
@diegomarquezp
test: ignore flaky tests in java-trace
a7c7cfc
@diegomarquezp
Merge branch 'observability/test/compute-integration-test' of https:/…
6bf1598
…/github.com/googleapis/google-cloud-java into observability/test/compute-integration-test
@diegomarquezp

diegomarquezp commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

gemini-code-assist[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gemini-code-assist[bot]
gemini-code-assist Bot reviewed Apr 30, 2026
View reviewed changes

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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.

Code Review

This pull request introduces integration tests for 'golden signals' (traces, metrics, and logs) within the Compute library, updating several POM files to include OpenTelemetry and Logback dependencies and configuring environment variables for logging. Feedback indicates that the selected Logback version (1.5.25) is incompatible with Java 8, which the repository maintains, and suggests using a thread-safe collection in the test appender to avoid potential concurrency issues.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread google-cloud-jar-parent/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp added 3 commits April 30, 2026 17:11
@diegomarquezp
fix: use thread safe list
748478f
@diegomarquezp
chore: timeout of 5 minutes for IT
3b1aa99
@diegomarquezp
chore: remove unused var
a3bd8ad
blakeli0
blakeli0 reviewed May 1, 2026
View reviewed changes
Comment thread java-logging-logback/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...ud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java
Duration pollInterval = Duration.ofSeconds(30);
TimeSeries targetTs = null;

while (metricsPollingStopwatch.elapsed().compareTo(totalTimeout) < 0) {

@blakeli0 blakeli0 May 1, 2026

Copy link
Copy Markdown
Contributor

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.

This while loop might be too aggressive, can we do it every x seconds?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@diegomarquezp diegomarquezp May 4, 2026

Copy link
Copy Markdown
Contributor Author

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.

I put a Thread.sleep() at the end of the while loop of 30 seconds.

google-cloud-java/java-compute/google-cloud-compute/src/test/java/com/google/cloud/compute/v1/integration/ITComputeGoldenSignals.java

Lines 528 to 530 in a3bd8ad

logger.info("Waiting for metrics in Cloud Monitoring, retrying in 30 seconds...");
Thread.sleep(pollInterval.toMillis());
}

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread java-compute/google-cloud-compute/pom.xml Resolved

Uh oh!

There was an error while loading. Please reload this page.

diegomarquezp added 4 commits May 4, 2026 12:54
@diegomarquezp
Merge remote-tracking branch 'origin/main' into observability/test/co…
5965bf2
…mpute-integration-test
@diegomarquezp
deps(compute): update trace dep to current snapshot
1344951
@diegomarquezp
deps(compute): update monitoring dep to current snapshot
a6ba158
@diegomarquezp
deps: add recommended dep
2f3d7d8
blakeli0
blakeli0 approved these changes May 4, 2026
View reviewed changes
@diegomarquezp
deps: add grpc auth dep
7724364
@diegomarquezp
diegomarquezp merged commit f1faf60 into main May 5, 2026
109 of 110 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@diegomarquezp
diegomarquezp deleted the observability/test/compute-integration-test branch May 5, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@blakeli0 blakeli0 blakeli0 approved these changes
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@diegomarquezp @blakeli0 @yoshi-kokoro @cloud-java-bot
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.