Skip to content

feat(storage): add resource span attributes for ACO ( App Centric Observability )#16119

Open
bajajneha27 wants to merge 23 commits into
googleapis:mainfrom
bajajneha27:509338299
Open

feat(storage): add resource span attributes for ACO ( App Centric Observability )#16119
bajajneha27 wants to merge 23 commits into
googleapis:mainfrom
bajajneha27:509338299

Conversation

@bajajneha27

Copy link
Copy Markdown
Contributor

No description provided.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label May 27, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a private helper method EnrichSpan to populate OpenTelemetry span attributes (gcp.resource.destination.id and gcp.resource.destination.location) using bucket metadata upon successful bucket operations (such as creation, retrieval, updates, and locking). It also adds corresponding unit tests to verify these attributes. The review comments suggest making EnrichSpan static since it does not access member variables, and checking for an uninitialized project number (value 0) to avoid generating invalid resource IDs.

Comment thread google/cloud/storage/internal/tracing_connection.cc
Comment thread google/cloud/storage/internal/tracing_connection.h Outdated
@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.27428% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.27%. Comparing base (9ea5a9d) to head (c276459).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../cloud/storage/internal/tracing_connection_test.cc 95.81% 9 Missing ⚠️
google/cloud/storage/grpc_plugin.cc 57.14% 3 Missing ⚠️
...oogle/cloud/storage/internal/tracing_connection.cc 99.10% 2 Missing ⚠️
...le/cloud/storage/internal/bucket_metadata_cache.cc 98.27% 1 Missing ⚠️
google/cloud/storage/internal/grpc/stub.h 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #16119    +/-   ##
========================================
  Coverage   92.26%   92.27%            
========================================
  Files        2214     2217     +3     
  Lines      206307   206837   +530     
========================================
+ Hits       190358   190862   +504     
- Misses      15949    15975    +26     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bajajneha27 bajajneha27 force-pushed the 509338299 branch 3 times, most recently from b9d9575 to 53127d4 Compare June 3, 2026 08:09
@bajajneha27 bajajneha27 force-pushed the 509338299 branch 2 times, most recently from c978382 to ab9f016 Compare June 9, 2026 10:56
@bajajneha27 bajajneha27 marked this pull request as ready for review June 9, 2026 15:26
@bajajneha27 bajajneha27 requested review from a team as code owners June 9, 2026 15:26
Comment thread google/cloud/storage/internal/tracing_connection.cc Outdated
Comment thread google/cloud/storage/internal/bucket_metadata_cache.cc Outdated
Comment thread google/cloud/storage/internal/tracing_connection.cc Outdated
Comment thread google/cloud/storage/internal/tracing_connection.cc Outdated
Comment thread google/cloud/storage/internal/tracing_connection.cc
@kalragauri kalragauri requested a review from cpriti-os June 10, 2026 09:39
Comment thread google/cloud/storage/internal/bucket_metadata_cache.h
TracingConnection::TracingConnection(std::shared_ptr<StorageConnection> impl)
: impl_(std::move(impl)) {}
: impl_(std::move(impl)),
background_threads_(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to always create an instance of BackgroundThreads. If the user has set the GrpcBackgroundThreadsFactoryOption they would expect the value of that Option to be used without creating another BackgroundThreads internally.

@@ -31,8 +36,17 @@ google::cloud::storage::Client MakeGrpcClient(Options opts) {
opts = google::cloud::storage_internal::DefaultOptionsGrpc(std::move(opts));
storage_internal::EnableGrpcMetrics(opts);
auto stub = std::make_unique<storage_internal::GrpcStub>(opts);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GrpcStub also calls MakeBackgroundThreadsFactory(opts)() internally, which means we are now creating two separate thread pools (and two separate completion queues) for every client. Is there a way to ensure the single pool is cleanly shared?

background_(MakeBackgroundThreadsFactory(options_)()),

if (!runner_) {
auto threads =
std::make_shared<google::cloud::rest_internal::
AutomaticallyCreatedRestPureBackgroundThreads>(1U);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This instantly spins up a dedicated background OS thread the moment the client is created. Should we initialize this lazily only when required?

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 Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants