Skip to content

Commit efaef3a

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

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

datadog_lambda/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@
1010

1111
initialize_cold_start_tracing()
1212

13+
1314
# The minor version corresponds to the Lambda layer version.
1415
# E.g.,, version 0.5.0 gets packaged into layer version 5.
1516
from datadog_lambda.version import __version__ # noqa: E402 F401
1617
from datadog_lambda.logger import initialize_logging # noqa: E402
1718

18-
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)