← All platforms

AWS Lambda (JavaScript) error tracking

A Lambda invocation is brief. The error report should stick around. The Sentry AWS SDK sends it to Telebugs on your server.

~/hoofnotes  npm install @sentry/aws-serverless
~/hoofnotes  nvim index.mjs
import * as Sentry from "@sentry/aws-serverless";
Sentry.init({
// Copy the complete Telebugs DSN, key and path included.
dsn: "YOUR_TELEBUGS_DSN",
});
import { saveNote } from "./hoofnotes/notes.mjs";
export const handler = Sentry.wrapHandler(saveNote);
~/hoofnotes  sam local invoke

Space pauses or resumes. R replays. Escape shows the complete setup.

Hang on, I already use Sentry

Keep @sentry/aws-serverless and change its destination to your Telebugs DSN. Your error reports stay on your server. You don’t need a Sentry account.

What happens when the invocation ends?

The Lambda wrapper handles sending captured errors before the invocation finishes. Your Telebugs server keeps the report after the function has stopped.

Do I need to give Telebugs access to my AWS account?

No. The SDK sends reports to your Telebugs DSN. Your function needs network access to that endpoint, not an AWS account integration inside Telebugs.