Skip to content

Commit

Permalink
Fix examples for custom clients not authenticating (#1450)
Browse files Browse the repository at this point in the history
Signed-off-by: clux <sszynrae@gmail.com>
  • Loading branch information
clux authored Mar 31, 2024
1 parent 49ef112 commit 156a6e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/custom_client_tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ async fn main() -> anyhow::Result<()> {
let https = config.openssl_https_connector()?;
let service = ServiceBuilder::new()
.layer(config.base_uri_layer())
.option_layer(config.auth_layer()?)
.service(hyper_util::client::legacy::Client::builder(TokioExecutor::new()).build(https));
Client::new(service, config.default_namespace)
} else {
let https = config.rustls_https_connector()?;
let service = ServiceBuilder::new()
.layer(config.base_uri_layer())
.option_layer(config.auth_layer()?)
.service(hyper_util::client::legacy::Client::builder(TokioExecutor::new()).build(https));
Client::new(service, config.default_namespace)
};
Expand Down
1 change: 1 addition & 0 deletions examples/custom_client_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async fn main() -> anyhow::Result<()> {
.layer(tower::limit::ConcurrencyLimitLayer::new(4))
// Add `DecompressionLayer` to make request headers interesting.
.layer(DecompressionLayer::new())
.option_layer(config.auth_layer()?)
.layer(
// Attribute names follow [Semantic Conventions].
// [Semantic Conventions]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-client
Expand Down

0 comments on commit 156a6e6

Please sign in to comment.