Skip to content
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

Feature Request: Disable lambda_unhandled_exception_warning_message #139

Open
packplusplus opened this issue Apr 11, 2024 · 2 comments
Open

Comments

@packplusplus
Copy link

The lambda_unhandled_exception_warning_message (LAMBDA_WARNING: Unhandled exception...) is ~ 633 chars and adds little value to our debugging. I understand the desire to warn people the runtime may have changed underfoot, and that's why their code is raising exceptions, but I'd like a way to disable it.

A pr from me would probably be something like

_disable_unhandled_exception_warning = bool(os.environ.get("AWS_LAMBDA_EXCEPTION_WARNING_DISABLE"))
# SNIP ...
if _disable_unhandled_exception_warning:
        from .lambda_literals import lambda_unhandled_exception_warning_message

        log_sink.log(lambda_unhandled_exception_warning_message, _WARNING_FRAME_TYPE)

log_error(error_result, log_sink)
lambda_runtime_client.post_invocation_error(
    invoke_id, to_json(error_result), to_json(xray_fault)
)

near

log_sink.log(lambda_unhandled_exception_warning_message, _WARNING_FRAME_TYPE)

Perhaps you have a different idea? Or maybe this is a non-starter. Didn't want to clutter PRs before asking.

@tlinhart
Copy link

tlinhart commented Oct 1, 2024

Another reason one might want to disable this message is that CloudWatch merges this warning with the actual error and handles it as a single log event. When using ALC with JSON log format, this makes it hard to parse the log event as JSON (in my case it's streamed to Grafana Loki).

image

@abillingsley
Copy link

abillingsley commented Oct 10, 2024

like @tlinhart we are facing this issue with our Cloudwatch logs which are forwarded to DataDog for aggregation. Not only is the structured logging lost but the ERROR log is reported as an INFO log message making monitoring of "ERROR" logs more difficult

Screenshot 2024-10-09 at 8 26 38 PM

Downgrading to 2.0.8 with no other changes yields the following

Screenshot 2024-10-09 at 8 59 01 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants