Skip to content

Commit c1a4ced

Browse files
authored
Revert "feat(sidekick): Inject InstrumentationClientInfo for tracing" (#2435)
Reverts #2252 My automated testing was wrong, it was happily disabled in both the lib.rs and transport.rs because the feature flag wasn't propagated. I have prepared a fix for the generator, but I'm finding this code incorrect and so I'd like to revert if it can be done cleanly.
1 parent dcbe063 commit c1a4ced

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

internal/sidekick/internal/rust/templates/crate/src/lib.rs.mustache

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,6 @@ pub(crate) mod info {
119119
ac.rest_header_value()
120120
};
121121
}
122-
{{#Codec.DetailedTracingAttributes}}
123-
pub(crate) static INSTRUMENTATION_CLIENT_INFO: gaxi::options::InstrumentationClientInfo = gaxi::options::InstrumentationClientInfo {
124-
service_name: "{{Name}}",
125-
client_version: VERSION,
126-
client_artifact: NAME,
127-
default_host: "{{Codec.DefaultHostShort}}",
128-
..Default::default()
129-
};
130-
{{/Codec.DetailedTracingAttributes}}
131122
}
132123

133124
{{/Codec.HasServices}}

internal/sidekick/internal/rust/templates/crate/src/transport.rs.mustache

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,20 +53,8 @@ impl std::fmt::Debug for {{Codec.Name}} {
5353
{{/Codec.PerServiceFeatures}}
5454
impl {{Codec.Name}} {
5555
pub async fn new(config: gaxi::options::ClientConfig) -> gax::client_builder::Result<Self> {
56-
{{#Codec.DetailedTracingAttributes}}
57-
let tracing_is_enabled = gaxi::options::tracing_enabled(&config);
58-
let inner = gaxi::http::ReqwestClient::new(config, crate::DEFAULT_HOST).await?;
59-
let inner = if tracing_is_enabled {
60-
inner.with_instrumentation(Some(crate::info::INSTRUMENTATION_CLIENT_INFO))
61-
} else {
62-
inner
63-
};
64-
Ok(Self { inner })
65-
{{/Codec.DetailedTracingAttributes}}
66-
{{^Codec.DetailedTracingAttributes}}
6756
let inner = gaxi::http::ReqwestClient::new(config, crate::DEFAULT_HOST).await?;
6857
Ok(Self { inner })
69-
{{/Codec.DetailedTracingAttributes}}
7058
}
7159
}
7260

0 commit comments

Comments
 (0)