Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 13 additions & 13 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions example/prepare.sh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had some problems getting the latest changes running in the example, so cleaning the node_modules ensures the code is properly refreshed.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
# Save the current directory
original_dir=$(pwd)

# Ensure installation is up to date
echo "Delete node_modules..."
rm -fr node_modules
echo "...done!"
echo

# Build the AWS Lambda package
echo "Building @raygun.io/aws-lambda package..."
cd .. || exit
rm -fr node_modules
npm install > /dev/null
cd "$original_dir" || exit
echo "...done!"
Expand Down
9 changes: 6 additions & 3 deletions lib/raygun.aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ async function runHandler<TEvent, TResult>(
context: Context,
asyncHandler: AsyncHandler<TEvent, TResult>,
) {
awsHandlerConfig.client.addBreadcrumb(
`Running AWS Function: ${context.functionName}`,
);
awsHandlerConfig.client.addBreadcrumb({
message: `Running AWS Function: ${context.functionName}`,
customData: context,
level: "info",
category: "AWS Handler",
});

try {
// Call to original handler and return value
Expand Down
1 change: 1 addition & 0 deletions test/raygun_aws_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ test("include scoped breadcrumbs", async function (t) {
t.equal(message.details.breadcrumbs.length, 2);
// internal breadcrumb
t.equal(message.details.breadcrumbs[0].message, "Running AWS Function: test");
t.equal(message.details.breadcrumbs[0].customData.functionName, "test");
// custom breadcrumb
t.equal(message.details.breadcrumbs[1].message, "custom breadcrumb");
});