question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[@sentry/node] AWS Lambda and other Serverless solutions support

See original GitHub issue
  • @sentry/node version 4.0.0-beta.11
  • I’m using hosted Sentry

What is the current behavior?

I’m using @sentry/node to capture exception on AWS lambda function.

    .catch(err => {
      Sentry.captureException(err)
      context.fail()
    })

However, it kills the process when context.fail() is called and the exception does not end up in Sentry.

I could do a workaround like:

    .catch(err => {
      Sentry.captureException(err)
      setTimeout(() => context.fail(), 1000)
    })

What is the expected behavior?

It would be nice if I can do something like:

    .catch(err => {
      Sentry.captureException(err, () => context.fail())
    })

Or something globally handle callback.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:78 (21 by maintainers)

github_iconTop GitHub Comments

29reactions
kamilogorekcommented, Nov 13, 2018

@LinusU we’ll most likely create a specific serverless package for this scenario. We just need to find some time, as it’s the end of the year and things are getting crowdy now. Will keep you posted!

29reactions
LinusUcommented, Nov 13, 2018

The dream API would be something like this 😍

Sentry.captureException(err: Error): Promise<void>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Serverless Sentry - Serverless Framework: Plugins
This Serverless plugin simplifies integration of Sentry with the popular Serverless Framework and AWS Lambda. Currently we support Lambda Runtimes for Node.js ...
Read more >
AWS Lambda | Sentry Documentation
Learn about Sentry's integration with AWS Lambda. ... We also support installing Sentry as a Container Image and installing Sentry in Lambda Layer....
Read more >
@sentry/serverless - npm
All methods available in @sentry/node can be imported from @sentry/serverless . Currently supported environment: AWS Lambda. To use this SDK, call Sentry.
Read more >
Serverless Computing - AWS Lambda - Amazon Web Services
AWS Lambda is a serverless compute service for running code without having to provision or manage servers. You pay only for the compute...
Read more >
AWS Lambda adds support for Node.js 18
Developers creating serverless applications in Lambda with Node.js 18 can take advantage of new features such as an upgrade of the bundled AWS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found