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 — feat: Instrument HTTP Reads and Rewrites by sydney-munro · Pull Request #2808 · googleapis/java-storage

This repository was archived by the owner on Sep 25, 2026. It is now read-only.

Conversation

@sydney-munro

@sydney-munro sydney-munro commented Nov 4, 2024

Copy link
Copy Markdown
Contributor

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

Sorry, something went wrong.

Uh oh!

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

All reactions
sydney-munro added 2 commits November 4, 2024 15:31
@sydney-munro
feat: Instrument HTTP Reads and Writes
39e6e59
@sydney-munro
Add tests
e4cb91a
@sydney-munro
sydney-munro requested a review from a team November 4, 2024 23:53
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: storage Issues related to the googleapis/java-storage API. labels Nov 4, 2024
@sydney-munro
lint
fc51962
@sydney-munro
sydney-munro requested review from JesseLovelace and frankyn November 5, 2024 16:14
frankyn
frankyn reviewed Nov 5, 2024
View reviewed changes
Comment thread google-cloud-storage/src/main/java/com/google/cloud/storage/spi/v1/HttpStorageRpc.java
@Override
public long read(
StorageObject from, Map<Option, ?> options, long position, OutputStream outputStream) {
OpenTelemetryTraceUtil.Span otelSpan = openTelemetryTraceUtil.startSpan("read");

@frankyn frankyn Nov 5, 2024

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.

I misunderstood the span name; Does startSpan provide context on class for this method?

Pattern: $package.$service/$method
Example using C++: storage::Client::WriteObject/CreateResumableUpload

Sorry, something went wrong.

Uh oh!

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

All reactions

@sydney-munro sydney-munro Nov 7, 2024

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.

yes https://github.com/googleapis/java-storage/blob/otel-v1-branch/google-cloud-storage/src/main/java/com/google/cloud/storage/otel/OpenTelemetryInstance.java#L156

Sorry, something went wrong.

Uh oh!

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

All reactions

@frankyn frankyn Nov 7, 2024

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.

Oh, I was thinking it would be

storage.spi.v1/read in this case so it's clear where this span exists.

@cojenco could you take a look at this?

Sorry, something went wrong.

Uh oh!

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

All reactions

@cojenco cojenco Nov 7, 2024

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.

+1 to providing context on the class/module for this method, especially considering there are many call paths in java

The OTel semantic conventions recommends the pattern of $package.$service/$method where $method MUST NOT contain slashes. I'm not very familiar with how the classes are structured here, but I agree that it would be a good idea to include some context of spi/v1/HttpStorageRpc in the span name for better debuggability

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread google-cloud-storage/src/test/java/com/google/cloud/storage/ITHttpOpenTelemetryTest.java Resolved

Uh oh!

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

@sydney-munro
refactor test logic
8f5f8d8
frankyn
frankyn approved these changes Nov 7, 2024
View reviewed changes

@frankyn frankyn 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.

We can always update span names after.

Sorry, something went wrong.

Uh oh!

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

cojenco reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@sydney-munro
sydney-munro merged commit 4538213 into otel-v1-branch Nov 7, 2024
@sydney-munro
sydney-munro deleted the http-instrument branch November 7, 2024 22:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@JesseLovelace JesseLovelace Awaiting requested review from JesseLovelace
2 more reviewers
@cojenco cojenco cojenco left review comments
@frankyn frankyn frankyn approved these changes
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

api: storage Issues related to the googleapis/java-storage API. size: m Pull request size is medium.

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.

3 participants

@sydney-munro @frankyn @cojenco
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.