-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat: Instrument HTTP Reads and Rewrites #2808
Conversation
@@ -848,9 +848,10 @@ private Get createReadRequest(StorageObject from, Map<Option, ?> options) throws | |||
@Override | |||
public long read( | |||
StorageObject from, Map<Option, ?> options, long position, OutputStream outputStream) { | |||
OpenTelemetryTraceUtil.Span otelSpan = openTelemetryTraceUtil.startSpan("read"); |
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
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.
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?
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
google-cloud-storage/src/test/java/com/google/cloud/storage/ITHttpOpenTelemetryTest.java
Outdated
Show resolved
Hide resolved
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.
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:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.