Skip to content

Commit 2df1b1d

Browse files
authored
Replace patch_all with modern config option ddtrace.auto (DataDog#20651)
* replace patch_all * changelog * relax test memory limit * Update test_db_statements.py
1 parent 19a9d94 commit 2df1b1d

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Replace patch_all with modern config ddtrace.auto

datadog_checks_base/datadog_checks/base/utils/tracing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ def traced_class(cls):
123123
try:
124124
integration_tracing_exhaustive = is_affirmative(datadog_agent.get_config('integration_tracing_exhaustive'))
125125

126-
from ddtrace import patch_all, tracer
127-
128-
patch_all()
126+
# https://ddtrace.readthedocs.io/en/stable/basic_usage.html#ddtrace-auto
127+
import ddtrace.auto # noqa: F401
128+
from ddtrace import tracer
129129

130130
def decorate(cls):
131131
for attr in cls.__dict__:

datadog_checks_base/tests/base/utils/db/test_db_statements.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def test_compute_derivative_rows_mem_usage(self):
278278
This test is skipped if tracemalloc is not available
279279
'''
280280
# The memory usage threshold takes tracing overhead into account
281-
MEMORY_USAGE_THRESHOLD = 8 * 1024 * 1024 # 8 MB
281+
MEMORY_USAGE_THRESHOLD = 10 * 1024 * 1024 # 10 MB
282282

283283
try:
284284
import tracemalloc

0 commit comments

Comments
 (0)