-
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: create(Blob) instrumentation #2792
base: otel-v1-branch
Are you sure you want to change the base?
Conversation
8cc3a2b
to
3856854
Compare
9efdd37
to
8fe835b
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.
still reviewing adding one question; I see it's WIP; are you ready for review?
google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java
Show resolved
Hide resolved
not yet just testing some stuff out as the testbench integration is a pain to sort out locally. |
google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java
Show resolved
Hide resolved
023a996
to
3543adf
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.
Have couple of comments; but LGTM, approving; feel free to merge after addressing them.
.asBlob(this); | ||
// Start the otel span to retain information of the origin of the request | ||
OpenTelemetryTraceUtil.Span otelSpan = | ||
openTelemetryTraceUtil.startSpan("create(BlobInfo, BlobTargetOption"); |
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.
From req doc; you only need method name and not parameters;
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.
helpful! I will remove the parameters.
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.
how do we want to differentiate create(Bucket) and create(Blob)?
List<SpanData> spanData = testExported.getExportedSpans(); | ||
// (1) Span when calling create | ||
// (2) Span when passing call to internalDirectUpload | ||
Assert.assertEquals(2, spanData.size()); |
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 can be brittle in the case new trace spans are introduced in underlying dependencies. Maybe you can test that the expected span names exist in the list of SpanData instead?
metadatas.add(info.getMetadata()); | ||
return super.internalDirectUpload(info, opts, buf); | ||
return super.internalDirectUpload(info, opts, buf, null); |
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.
What about an overload so or object that represents default context (no-op)?
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.
thats a good idea.
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.