Improve tracing for keyring provider (#3207)

This commit is contained in:
Zanie Blue 2024-04-23 09:23:21 -05:00 committed by GitHub
parent 598a67cf31
commit b8302d44de
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,6 +38,7 @@ impl KeyringProvider {
/// ///
/// Returns [`None`] if no password was found for the username or if any errors /// Returns [`None`] if no password was found for the username or if any errors
/// are encountered in the keyring backend. /// are encountered in the keyring backend.
#[instrument(skip_all, fields(url = % url.to_string(), username))]
pub(crate) async fn fetch(&self, url: &Url, username: &str) -> Option<Credentials> { pub(crate) async fn fetch(&self, url: &Url, username: &str) -> Option<Credentials> {
// Validate the request // Validate the request
debug_assert!( debug_assert!(
@ -104,7 +105,7 @@ impl KeyringProvider {
password.map(|password| Credentials::new(Some(username.to_string()), Some(password))) password.map(|password| Credentials::new(Some(username.to_string()), Some(password)))
} }
#[instrument] #[instrument(skip(self))]
async fn fetch_subprocess(&self, service_name: &str, username: &str) -> Option<String> { async fn fetch_subprocess(&self, service_name: &str, username: &str) -> Option<String> {
let output = Command::new("keyring") let output = Command::new("keyring")
.arg("get") .arg("get")