-
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
chore: misc otel internalization/cleanup #2835
Conversation
@@ -219,7 +220,7 @@ public Bucket create(BucketInfo bucketInfo, BucketTargetOption... options) { | |||
.setParent("projects/_"); | |||
CreateBucketRequest req = opts.createBucketsRequest().apply(builder).build(); | |||
GrpcCallContext merge = Utils.merge(grpcCallContext, Retrying.newCallContext()); | |||
try (OpenTelemetryTraceUtil.Scope unused = otelSpan.makeCurrent()) { | |||
try (OpenTelemetryTraceUtil.Scope ignored = otelSpan.makeCurrent()) { |
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.
renamed variables to remove warnings from intellij.
this.storageOptions = storageOptions; | ||
this.openTelemetry = storageOptions.getOpenTelemetrySdk(); | ||
this.tracer = | ||
openTelemetry.getTracer(LIBRARY_NAME, GaxProperties.getLibraryVersion(this.getClass())); | ||
this.tracer = openTelemetry.getTracer(LIBRARY_NAME, storageOptions.getLibraryVersion()); |
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.
Switch to using the logic from storageOptions rather than gax. Our version is more stable to repackaging, and is what is used for headers and such. We will want to keep them in sync.
@@ -193,9 +191,9 @@ private SpanBuilder addSettingsAttributesToCurrentSpan(SpanBuilder spanBuilder) | |||
spanBuilder = | |||
spanBuilder.setAllAttributes( | |||
Attributes.builder() | |||
.put("gcp.client.version", GaxProperties.getLibraryVersion(this.getClass())) | |||
.put("gcp.client.version", storageOptions.getLibraryVersion()) |
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.
ditto
.put("gcp.client.repo", "googleapis/java-storage") | ||
.put("gcp.client.artifact", "com.google.cloud.google-cloud-storage") | ||
.put("gcp.client.artifact", "com.google.cloud:google-cloud-storage") |
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.
use the maven package format
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.
LGTM, thanks for taking care of that!
No description provided.