Unverified Commit a411bc3b authored by Russell Cohen's avatar Russell Cohen Committed by GitHub
Browse files

Endpoint docs & aws-config spans (#1087)

* Add more details to custom endpoint docs

* Cleanup aws-config spans

* Cleanup aws-config spans

* Cleanups & update changelog
parent c18af759
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -10,3 +10,15 @@
# references = ["smithy-rs#920"]
# meta = { "breaking" = false, "tada" = false, "bug" = false }
# author = "rcoh"

[[aws-sdk-rust]]
message = "Convert several `info` spans to `debug` in aws-config"
references = ["smithy-rs#1087"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "rcoh"

[[smithy-rs]]
message = "Improve docs on `Endpoint::{mutable, immutable}`"
references = ["smithy-rs#1087"]
meta = { "breaking" = false, "tada" = false, "bug" = false }
author = "rcoh"
 No newline at end of file
+10 −1
Original line number Diff line number Diff line
@@ -420,9 +420,11 @@ pub mod timeout_config {
/// Typically, this module is used via [`load_from_env`](crate::load_from_env) or [`from_env`](crate::from_env). It should only be used directly
/// if you need to set custom configuration options like [`region`](credentials::Builder::region) or [`profile_name`](credentials::Builder::profile_name).
pub mod credentials {
    use aws_types::credentials;
    use std::borrow::Cow;

    use aws_types::credentials::{future, ProvideCredentials};
    use tracing::Instrument;

    use crate::environment::credentials::EnvironmentVariableCredentialsProvider;
    use crate::meta::credentials::{CredentialsProviderChain, LazyCachingCredentialsProvider};
@@ -481,6 +483,13 @@ pub mod credentials {
        pub fn builder() -> Builder {
            Builder::default()
        }

        async fn credentials(&self) -> credentials::Result {
            self.0
                .provide_credentials()
                .instrument(tracing::info_span!("provide_credentials", provider = %"default_chain"))
                .await
        }
    }

    impl ProvideCredentials for DefaultCredentialsChain {
@@ -488,7 +497,7 @@ pub mod credentials {
        where
            Self: 'a,
        {
            self.0.provide_credentials()
            future::ProvideCredentials::new(self.credentials())
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ impl ProvideRegion for ImdsRegionProvider {
    fn region(&self) -> future::ProvideRegion {
        future::ProvideRegion::new(
            self.region()
                .instrument(tracing::info_span!("imds_load_region")),
                .instrument(tracing::debug_span!("imds_load_region")),
        )
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -76,7 +76,7 @@ impl CredentialsProviderChain {

    async fn credentials(&self) -> credentials::Result {
        for (name, provider) in &self.providers {
            let span = tracing::info_span!("load_credentials", provider = %name);
            let span = tracing::debug_span!("load_credentials", provider = %name);
            match provider.provide_credentials().instrument(span).await {
                Ok(credentials) => {
                    tracing::info!(provider = %name, "loaded credentials");
+1 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ impl ProvideCredentials for LazyCachingCredentialsProvider {
        future::ProvideCredentials::new(async move {
            // Attempt to get cached credentials, or clear the cache if they're expired
            if let Some(credentials) = cache.yield_or_clear_if_expired(now).await {
                tracing::debug!("loaded credentials from cache");
                Ok(credentials)
            } else {
                // If we didn't get credentials from the cache, then we need to try and load.
Loading