Skip to content
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

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

BenWhitehead
Copy link
Collaborator

No description provided.

@BenWhitehead BenWhitehead added the owlbot:ignore instruct owl-bot to ignore a PR label Dec 5, 2024
@BenWhitehead BenWhitehead requested a review from a team as a code owner December 5, 2024 20:21
@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 Dec 5, 2024
@@ -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()) {
Copy link
Collaborator Author

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());
Copy link
Collaborator Author

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())
Copy link
Collaborator Author

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")
Copy link
Collaborator Author

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

Copy link
Collaborator

@sydney-munro sydney-munro left a 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!

@sydney-munro sydney-munro merged commit 6a2b3ca into otel-v1-branch Dec 5, 2024
17 checks passed
@sydney-munro sydney-munro deleted the otel-review-cleanup branch December 5, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. owlbot:ignore instruct owl-bot to ignore a PR size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants