BugSnag automatically captures a variety of data to help you debug your errors. You may wish to avoid capturing some types of data, particularly if there are privacy implications for your users.
BugSnag will automatically capture the Lambda function’s event
& context
arguments in the “AWS Lambda Event” & “AWS Lambda Context” tabs on every error.
You can remove individual items from these tabs using params_filters
:
bugsnag.configure(
params_filters=["invoked_function_arn", "headers"],
)
You can also remove the tab entirely using a before_notify
callback:
def remove_aws_metadata(event):
if "AWS Lambda Event" in event.metadata
del event.metadata["AWS Lambda Event"]
if "AWS Lambda Context" in event.metadata
del event.metadata["AWS Lambda Context"]
bugsnag.before_notify(remove_aws_metadata)
If the logging integration is used, some contextual information is collected to populate the “extra data” tab.
Data | Default value | Preventing collection |
---|---|---|
asctime |
The formatted time string of when the log occurred | Modify metadata['extra_data'] in a callback |
Created | The time the log occurred | Modify metadata['extra_data'] in a callback |
Level name | The text level of the log | Modify metadata['extra_data'] in a callback |
Level number | The numeric level of the log | Modify metadata['extra_data'] in a callback |
msecs |
The milliseconds portion of the created time | Modify metadata['extra_data'] in a callback |
Name | The name of the logger | Modify metadata['extra_data'] in a callback |
Process | The ID of the running process | Modify metadata['extra_data'] in a callback |
Process name | The name of the running process | Modify metadata['extra_data'] in a callback |
Data | Default value | Preventing collection |
---|---|---|
Log messages | The log message and its level. Only collected when using the breadcrumb log filter. | Set enabled_breadcrumb_types or modify/discard the breadcrumb in an on_breadcrumb callback |