awslabs / aws-sdk-rust

AWS SDK for the Rust Programming Language
https://awslabs.github.io/aws-sdk-rust/
Apache License 2.0
3.03k stars 248 forks source link

Region provider dominates log output #1184

Open sergiimk opened 2 months ago

sergiimk commented 2 months ago

Describe the bug

This line adds a Debug representation of a dyn ProvideRegion as an argument of a tracing span.

Providers such as DefaultRegionChain are highly nested objects, Debug representation of which can be multiple pages of text long.

Tracing arguments in many configurations of tracing are be printed per every every log event as context.

As a result, every log message produced within this instrumented span creates a wall of output.

Expected Behavior

Tracing spans only include short arguments.

Current Behavior

When log level is set to info we get a 2-page log message per new / close span events.

Under debug logging our server logs are 90% dominated by init_s3_context{..}:load_region{...}. One S3 read produces hundreds of pages of this: image

Reproduction Steps

n/a

Possible Solution

If you believe that full Debug representation of a provider is useful - instead of adding it to the span it could be logged as an event, so that it only appears in logs once.

Additional Information/Context

No response

Version

`main` branch

Environment details (OS name and version, etc.)

irrelevant

Logs

No response

ysaito1001 commented 2 months ago

@sergiimk Thank you for bringing this to our attention! I see that the attached wall of text primarily comes from runtime plugins and runtime components associated with an IMDS client used internally. We have attempted to reduce log verbosity in the past (example PR), but it's clear that further reductions are needed.