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.

Exceptions from AWS Lambda not making it to Sentry project

See original GitHub issue

Package

Sentry.AspNetCore

.NET Flavor

.NET Core

.NET Version

6.0.6

OS

Other

SDK Version

Assembly Sentry, Version=3.20.1.0

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Initialization
protected override void Init(IWebHostBuilder builder)
{
  builder.UseSentry(o =>
      {
          o.Dsn = sentryDsn;
          o.Debug = true;
          o.FlushOnCompletedRequest = true;
          o.FlushTimeout = TimeSpan.FromSeconds(sentryFlushTimeout);
          o.TracesSampleRate = 1.0;
          o.ConfigureScope(scope =>
          {
              scope.SetTag("lambda", _sentryTag);
          });
      });

    builder.UseStartup<Startup>();
}
  1. Capture Event
protected Guid? CaptureEvent(Exception? ex)
{
    return Sentry.SentrySdk.CaptureEvent(new Sentry.SentryEvent(ex));
}
  1. Cloudwatch log shows these entries in the event of an exception:
2022-07-28T14:38:46.720Z	5619f8f9-...	[Information] Sentry.ISentryClient: Capturing event. 
2022-07-28T14:38:47.400Z	5619f8f9-...	[Information] Sentry.ISentryClient: Envelope queued up: 'd498d...' 

Expected Result

Expect to see the exceptions captured in the Sentry project, not seeing them.

Am seeing some events captured from previous days so I know Sentry is at least intermittently functional.

Currently adding tagging, should see the exception being tagged.

Actual Result

Have exceptions in the project from 2 days ago but not today when I triggered the error.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dr3xcommented, Aug 15, 2022

@mattjohnsonpint - more info that might be helpful - Seems that the Sentry client is arbitrarily exiting before the lambda does:

2022-08-15T15:20:40.655Z	febe7822-14d9-48f9-a8c9-02c204de867d	
[Information] Sentry.ISentryClient: Shutdown token triggered. Time to exit. #1 in queue. 

When the exceptions are successfully making it over then you see something like this:

2022-08-15T12:13:02.136Z	d7a84002-9c82-446f-a0b1-53d05cce481a	
[Information] Sentry.ISentryClient: Envelope 'd5a90b...' successfully received by Sentry.

In either case, the entry is preceded by these two log entries consistently: [Information] Sentry.ISentryClient: Capturing event.

[Information] Sentry.ISentryClient: Envelope queued up: 'd5a90b...'

1reaction
mattjohnsonpintcommented, Jul 28, 2022

I’ll take another look. Thanks for reporting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting for AWS Lambda
If Sentry cannot locate symbols, then it cannot perform symbolication of stack traces. This means that for some types of projects (depending on...
Read more >
Sentry on AWS lambda in nodejs doesn't send exception
I'm trying to configure sentry on AWS Lambda (nodejs 8.10) but the exceptions are not sent to Sentry. I'm the feeling that is...
Read more >
Lambda Error Logging With Sentry - Oliver Roick
Every unhandled exception is a bug in your software. Things will go wrong in your Lambda function, and you want to know about...
Read more >
️ Serverless Sentry Plugin
This Serverless plugin simplifies integration of Sentry with the popular Serverless Framework and AWS Lambda. Currently we support Lambda Runtimes for ...
Read more >
serverless-sentry-lib | npm Security Analysis
The plugin captures these unhandled exceptions, forwards them to Sentry and then exits the Lambda with an error code. Local Development. By default...
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