feat(storage): add resource span attributes for ACO ( App Centric Observability ) for async client#16151
feat(storage): add resource span attributes for ACO ( App Centric Observability ) for async client#16151bajajneha27 wants to merge 21 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a BucketMetadataCache to cache bucket metadata (ID and location) and uses it to enrich OpenTelemetry spans with destination resource attributes in both TracingConnection and AsyncConnectionTracing. When metadata is not cached, a background fetch is triggered. The review feedback highlights several important issues: a critical data race on bg_tasks_ in TracingConnection::MaybeTriggerBackgroundFetch due to a lack of mutex protection during push_back, potential undefined behavior in BucketMetadataCache::Put if max_size is initialized to 0, unnormalized bucket names on permission denied errors in TracingConnection, and performance concerns regarding the expensive creation of a new StorageConnection on every background fetch in AsyncConnectionTracing.
| } else if (result.status().code() == StatusCode::kPermissionDenied) { | ||
| cache().Put(bucket_name, {"projects/_/buckets/" + bucket_name, "global"}); | ||
| } |
There was a problem hiding this comment.
To be consistent with AsyncConnectionTracing and to handle any potentially unnormalized bucket names safely, normalize the bucket_name before constructing the fallback resource ID on kPermissionDenied errors.
} else if (result.status().code() == StatusCode::kPermissionDenied) {
auto const normalized = BucketMetadataCache::NormalizeBucketName(bucket_name);
cache().Put(bucket_name, {"projects/_/buckets/" + normalized, "global"});
}
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #16151 +/- ##
==========================================
+ Coverage 92.27% 92.29% +0.01%
==========================================
Files 2214 2217 +3
Lines 206537 207397 +860
==========================================
+ Hits 190589 191408 +819
- Misses 15948 15989 +41 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9450ced to
db490d9
Compare
6b19ba0 to
bdd8085
Compare
…ervability ) for async client
c071cb2 to
a8a456d
Compare
No description provided.