test(o11y): add storage grpc tracing integration test#5343
Conversation
2bc45ca to
bb8014b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5343 +/- ##
=======================================
Coverage 97.78% 97.78%
=======================================
Files 222 222
Lines 46128 46128
=======================================
+ Hits 45104 45107 +3
+ Misses 1024 1021 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
1b9e80e to
6522b8c
Compare
6522b8c to
77294bd
Compare
westarle
left a comment
There was a problem hiding this comment.
I think this needs a lot of cleanup before we submit. If we need it (i.e. we don't have coverage through some other testing) I think it's a good idea to turn it into incremental PRs (i.e. a PR to add the test rig and one test, another PR to add additional tests.)
| use tracing_subscriber::util::SubscriberInitExt; | ||
|
|
||
| #[tokio::test(flavor = "multi_thread", worker_threads = 2)] | ||
| pub async fn f1_6_grpc_disablement() -> anyhow::Result<()> { |
There was a problem hiding this comment.
please give these meaningful names that don't depend on the test plan.
| .find(|s| s.name == "delete_bucket" || s.name == "google.storage.v2.Storage/DeleteBucket") | ||
| .expect("Should have a DeleteBucket span"); | ||
|
|
||
| /* Temporarily ignore span check |
There was a problem hiding this comment.
I think we should not ignore the span check?
| )) | ||
| .set_default(); | ||
|
|
||
| // 1. Setup Mock gRPC Storage Server to fail immediately |
There was a problem hiding this comment.
extract methods for some of these to reduce reliance on comments...
| }) | ||
| .expect("Should have a DeleteBucket span"); | ||
|
|
||
| // 5. Verify Metrics |
There was a problem hiding this comment.
we might want to break out independent tests, or at least independent verifications.
Add an integration test suite for storage gRPC o11y to verify that required attributes are propagated according to OTel semconv.
Also verify that
gcp.client.*attributes (such asgcp.client.repo,gcp.client.artifact,gcp.client.version, andgcp.client.service) are correctly included in theInstrumentationScopefor metrics.Note:
gcp.client.*attributes are currently missing on the low-level gRPC transport span (T4 tracing) and require to be populated in the transport layer.