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

feat: introductory beta level support for OpenTelemetry tracing on c.g.c.storage.Storage methods #2837

Merged
merged 29 commits into from
Jan 6, 2025

Conversation

sydney-munro
Copy link
Collaborator

@sydney-munro sydney-munro commented Dec 6, 2024

Introducing OpenTelemetry Tracing

@sydney-munro sydney-munro requested review from a team as code owners December 6, 2024 22:02
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. api: storage Issues related to the googleapis/java-storage API. labels Dec 6, 2024
@BenWhitehead BenWhitehead added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 9, 2024
@sydney-munro sydney-munro added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 17, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 17, 2024
@sydney-munro sydney-munro removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 17, 2024
@sydney-munro sydney-munro added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 17, 2024
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 17, 2024
@googleapis googleapis deleted a comment from generated-files-bot bot Dec 17, 2024
@sydney-munro sydney-munro changed the title Feat: OpenTelemetry Trace Support feat: OpenTelemetry Trace Support Dec 17, 2024
sydney-munro and others added 2 commits January 2, 2025 10:17
… in method modification (#2856)

Refactor com.google.cloud.storage.Storage otel tracing to be based on a decorating instance of Storage rather than modifying the implementations of StorageImpl and GrpcStorageImpl directly.

This simplifies things by ensuring any otel tracing for c.g.c.s.Storage is implemented for both http and grpc at the same time and with the same metadata.

As a side effect, the previous com.google.cloud.storage.otel package has been removed.

The number of lines appears daunting, however a high level overview of the actual modifications:
1. Remove otel tracing from StorageImpl
2. Remove otel tracing from GrpcStorageImpl
3. Cleanup StorageOption 
   1. classes to specify `@BetaApi` on all otel related methods
   2. Add `{Http,Grpc}StorageDefaults.getDefaultOpenTelemetry` default which points at `OpenTelemetry.noop()`
   3. Relax dependency on OpenTelemetrySdk to only OpenTelemetry
4. Add OtelStorageDecorator (~1700 Lines of the PR) to decorate nearly all public api methods (excluding batch())
   * Each method is "logicless" for the most part, and was generated with the help of IntelliJ live templates
   * Each method is generally: Define span, and scope invoke delegate catch any exception and complete the span
   * There are sub decorators for ReadChannel, WriteChannel, BlobWriteSession and CopyWriter which carry the originating span along for their lifetimes
5. Remote `com.google.cloud.storage.otel` package and helpers
6. Update assertions in ITOpenTelemetryTest to be wrapped in an `assertAll`
@BenWhitehead BenWhitehead changed the title feat: OpenTelemetry Trace Support feat: introductory beta level support for OpenTelemetry tracing on c.g.c.storage.Storage methods Jan 6, 2025
@sydney-munro sydney-munro merged commit dd889ea into main Jan 6, 2025
22 checks passed
@BenWhitehead BenWhitehead deleted the otel-v1-branch branch January 7, 2025 17:40
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. size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants