Skip to content

Commit

Permalink
Reduced the volume of logging from the botocore library (#19376)
Browse files Browse the repository at this point in the history
* Prevent propagation of botocore logs into the Agent

* Add changelog
  • Loading branch information
Kyle-Neale authored Jan 13, 2025
1 parent faf3717 commit 64cafe2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions amazon_msk/changelog.d/19376.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Reduced the volume of logging from the `botocore` library
6 changes: 6 additions & 0 deletions amazon_msk/datadog_checks/amazon_msk/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ class AmazonMskCheckV2(OpenMetricsBaseCheckV2, ConfigMixin):
def __init__(self, name, init_config, instances):
super().__init__(name, init_config, instances)

# This prevents botocore INFO logs from being printed in the Agent log
# https://github.com/boto/botocore/blob/develop/botocore/credentials.py#L1075
import logging

logging.getLogger('botocore').setLevel(logging.CRITICAL)

self._region_name = None
self._exporter_data = None
self._endpoint_prefix = None
Expand Down

0 comments on commit 64cafe2

Please sign in to comment.