You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(sidekick/rust): Update templates for otel (#2443)
- Conditionally include `INSTRUMENTATION_CLIENT_INFO` static in
`lib.rs.mustache` using `lazy_static!` based on the
`DetailedTracingAttributes` flag.
- Conditionally add `.with_instrumentation()` call in
`transport.rs.mustache` based on the `DetailedTracingAttributes` flag.
Tested:
1. **Flag ON Test:**
- Reset showcase: `git reset --hard HEAD && git clean -fdx` in
`google-cloud-rust/src/generated/showcase`
- Regenerate: `go run ./cmd/sidekick refresh -project-root
../google-cloud-rust -output src/generated/showcase -codec-option
detailed-tracing-attributes=true` in `librarian`
- Format: `cargo fmt -p google-cloud-showcase-v1beta1` in
`google-cloud-rust`
- Build & Test: `cargo build -p google-cloud-showcase-v1beta1 && cargo
test -p google-cloud-showcase-v1beta1` in `google-cloud-rust` - PASSED
2. **Flag OFF Test:**
- Reset showcase: `git reset --hard HEAD && git clean -fdx` in
`google-cloud-rust/src/generated/showcase`
- Modified `google-cloud-rust/src/generated/showcase/.sidekick.toml` to
set `detailed-tracing-attributes = false`
- Regenerate: `go run ./cmd/sidekick refresh -project-root
../google-cloud-rust -output src/generated/showcase` in `librarian`
- Format: `cargo fmt -p google-cloud-showcase-v1beta1` in
`google-cloud-rust`
- Diff: `git diff` in `google-cloud-rust/src/generated/showcase` -
Showed no instrumentation code added, confirming the flag works.
For googleapis/google-cloud-rust#3239
0 commit comments