-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
The botocore.utils.py
file currently has debug logs enabled for both the IMDS (Instance Metadata Service) fetcher and S3 operations. This is causing performance issues when trying to debug NoCredentialsFound
errors, as the debug logs from S3 operations are also being generated, which can significantly impact application performance.
This is what I did to enable debug logs from credentials fetchers,
boto3.set_stream_logger('botocore.utils', logging.DEBUG)
boto3.set_stream_logger('botocore.credentials', logging.DEBUG)
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
I would like to have a way to selectively enable debug logs only for the credentials fetch process, without enabling debug logs for other parts of the botocore library, such as S3 operations. This would allow me to effectively debug NoCredentialsFound
errors without the performance impact of excessive debug logging.
Current Behavior
Too many logs
Reproduction Steps
Run below program and observe the amount of logs generated,
import boto3
import logging
boto3.set_stream_logger('botocore.utils', logging.DEBUG)
boto3.set_stream_logger('botocore.credentials', logging.DEBUG)
boto3.Session().client('s3').get_object(...) #
Possible Solution
Introduce a new configuration option or a logging filter that would allow users to enable debug logging specifically for the credentials fetch process, without affecting the logging behavior of other parts of the botocore library.
Additional Information/Context
No response
SDK version used
Latest
Environment details (OS name and version, etc.)
Amazon Linux