I’m interested in using the breadcrumb feature for our AWS Lambda functions. Unfortunately, the documentation isn’t clear if this would actually work given the concurrent and asynchronous nature of AWS Lambdas .
Since AWS function calls can run in parallel in the sane Node instance, if two parallel function calls adds breadcrumbs and later throws error events, would the breadcrumbs be mixed together in the events or kept separate for each function call / event? The only way the would be kept separate would if be if the wrapper call create some kind context for each function call that Sentry.addBreadcrumb would be aware of, but I’m uncertain that would even be possible.
const Sentry = require("@sentry/serverless");
Sentry.AWSLambda.init({
dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0,
});
exports.handler = Sentry.AWSLambda.wrapHandler(async (event, context) => {
Sentry.addBreadcrumb({
category: "example",
message: "Would this breadcrumb be connected to this specific AWS lambda event?",
level: Sentry.Severity.Info,
});
(function() {
Sentry.addBreadcrumb({
category: "example",
message: "If so, would it also be it within this scope?",
level: Sentry.Severity.Info,
});
})()
});