Skip to content

Commit 87adb4d

Browse files
authored
safety check before create cold start spans (#485)
1 parent dc03756 commit 87adb4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

datadog_lambda/cold_start.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ def trace(self, root_nodes: List[ImportNode] = root_nodes):
197197

198198
def trace_tree(self, import_node: ImportNode, parent_span):
199199
if (
200-
import_node.end_time_ns - import_node.start_time_ns
200+
not self.trace_ctx
201+
or import_node.end_time_ns - import_node.start_time_ns
201202
< self.min_duration_ms * 1e6
202203
or import_node.module_name in self.ignored_libs
203204
):

0 commit comments

Comments
 (0)