Skip to content

Catch invocation event tag extraction exceptions #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 3, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions datadog_lambda/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def __init__(self, func):
self.extractor_env = os.environ.get("DD_TRACE_EXTRACTOR", None)
self.trace_extractor = None
self.span = None
self.response = None

if self.extractor_env:
extractor_parts = self.extractor_env.rsplit(".", 1)
Expand All @@ -119,8 +120,6 @@ def __init__(self, func):

def __call__(self, event, context, **kwargs):
"""Executes when the wrapped function gets called"""
self.trigger_tags = extract_trigger_tags(event, context)
self.response = None
init_lambda_stats()
self._before(event, context)
try:
Expand All @@ -136,9 +135,9 @@ def __call__(self, event, context, **kwargs):

def _before(self, event, context):
try:

set_cold_start()
submit_invocations_metric(context)
self.trigger_tags = extract_trigger_tags(event, context)
# Extract Datadog trace context and source from incoming requests
dd_context, trace_context_source = extract_dd_trace_context(
event, context, extractor=self.trace_extractor
Expand Down