-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve credentials tracing #2062
Conversation
These spans are handled more generically in the default chain.
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
@@ -152,7 +152,7 @@ impl ImdsCredentialsProvider { | |||
Err(ImdsError::ErrorResponse(context)) | |||
if context.response().status().as_u16() == 404 => | |||
{ | |||
tracing::info!( | |||
tracing::warn!( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
users are gonna love this
let future = Timeout::new(loader.provide_credentials(), timeout_future); | ||
cache | ||
let start_time = Instant::now(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should use tokio::time::Instant
in this so that this is more controllable in tests. Maybe it would be worth testing cache miss time? IDK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using tokio::time::Instant
in tests is fine, but I'm not as sold on using it in the actual code (without abstracting it in some way) since it requires the time
feature, which pulls in Tokio's async sleep. I don't think this specific case really needs a test.
A new generated diff is ready to view.
A new doc preview is ready to view. |
Motivation and Context
This PR adds an
info
event for each time there is a credentials cache miss with the time it took to reload credentials, removes some duplicate provider spans, and adjusts some event/span levels.Checklist
CHANGELOG.next.toml
if I made changes to the AWS SDK, generated SDK code, or SDK runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.