Skip to content

Commit 1484b5e

Browse files
committed
Move patch_all to init.
1 parent ddcae27 commit 1484b5e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

datadog_lambda/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@
1717

1818

1919
initialize_logging(__name__)
20+
21+
22+
from datadog_lambda.patch import patch_all # noqa: E402
23+
24+
# Patch third-party libraries for tracing, must be done before importing any
25+
# handler code.
26+
patch_all()

datadog_lambda/wrapper.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
Headers,
2626
)
2727
from datadog_lambda.module_name import modify_module_name
28-
from datadog_lambda.patch import patch_all
2928
from datadog_lambda.span_pointers import calculate_span_pointers
3029
from datadog_lambda.tag_object import tag_object
3130
from datadog_lambda.tracing import (
@@ -47,10 +46,6 @@
4746
extract_http_status_code_tag,
4847
)
4948

50-
# Patch third-party libraries for tracing, must be done before importing any
51-
# handler code.
52-
patch_all()
53-
5449
if config.profiling_enabled:
5550
from ddtrace.profiling import profiler
5651

0 commit comments

Comments
 (0)