-
Notifications
You must be signed in to change notification settings - Fork 390
feat(aws): Add scheduled invocation for retry event #1027
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
Changes from 3 commits
dd4ca38
c366dfe
ca4f033
b1f552e
3011651
f2298b2
d4ee4ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,17 @@ def datadog_forwarder(event, context): | |
| init_cache_layer(function_prefix) | ||
| init_forwarder(function_prefix) | ||
|
|
||
| if len(event) == 1 and str(event.get(DD_RETRY_KEYWORD, "false")).lower() == "true": | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in which cases would we receive a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know, but we want to launch the retry only mode in the very specific For example if SQS or async invocation of the lambda add this kind of entry in the received event, we'll do both the retry failed events and processing the event. To avoid forwarding this specific event (the |
||
| logger.info("Retry-only invocation") | ||
|
|
||
| try: | ||
| forwarder.retry() | ||
| except Exception as e: | ||
| if logger.isEnabledFor(logging.DEBUG): | ||
| logger.debug(f"Failed to retry forwarding {e}") | ||
|
|
||
| return | ||
|
|
||
| parsed = parse(event, context, cache_layer) | ||
| enriched = enrich(parsed, cache_layer) | ||
| transformed = transform(enriched) | ||
|
|
@@ -71,12 +82,11 @@ def datadog_forwarder(event, context): | |
| parse_and_submit_enhanced_metrics(logs, cache_layer) | ||
|
|
||
| try: | ||
| if bool(event.get(DD_RETRY_KEYWORD, False)) is True: | ||
| if str(event.get(DD_RETRY_KEYWORD, "false")).lower() == "true": | ||
| forwarder.retry() | ||
| except Exception as e: | ||
| if logger.isEnabledFor(logging.DEBUG): | ||
| logger.debug(f"Failed to retry forwarding {e}") | ||
| pass | ||
|
|
||
|
|
||
| def init_cache_layer(function_prefix): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.