nestjs-sentry icon indicating copy to clipboard operation
nestjs-sentry copied to clipboard

Store non-error messages as breadcrumbs on SentryService logger methods

Open empz opened this issue 4 years ago • 9 comments

empz avatar Jun 09 '21 08:06 empz

@msimon and @empz This update was added to v2.0.8

ntegral avatar Jul 13 '21 01:07 ntegral

I'm a bit confused. It seems that this behaviour is already presente in master... where captureMessage are commented out.

But what I find strange is that this is a BC. Maybe it would need a major version not a patch.

lucasaba avatar Jul 15 '21 15:07 lucasaba

This has been corrected.. This will get rolled into 3.0.0 as the option to send as breadcrumb or message.

Thanks.. see version 2.0.9

From: Luca Saba @.> Date: Thursday, July 15, 2021 at 11:53 AM To: ntegral/nestjs-sentry @.> Cc: Dexter Hardy @.>, Comment @.> Subject: Re: [ntegral/nestjs-sentry] Store non-error messages as breadcrumbs on SentryService logger methods (#42)

I'm a bit confused. It seems that this behaviour is already presente in master... where captureMessage are commented outhttps://github.com/ntegral/nestjs-sentry/blob/master/lib/sentry.service.ts#L64.

But what I find strange is that this is a BC. Maybe it would need a major version not a patch.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ntegral/nestjs-sentry/pull/42#issuecomment-880810353, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADEYTTNLNUD3KP5R4UP6JWLTX375XANCNFSM46LSWW4A.

ntegral avatar Jul 15 '21 16:07 ntegral

This has been corrected.. This will get rolled into 3.0.0 as the option to send as breadcrumb or message. Thanks.. see version 2.0.9 From: Luca Saba @.> Date: Thursday, July 15, 2021 at 11:53 AM To: ntegral/nestjs-sentry @.> Cc: Dexter Hardy @.>, Comment @.> Subject: Re: [ntegral/nestjs-sentry] Store non-error messages as breadcrumbs on SentryService logger methods (#42) I'm a bit confused. It seems that this behaviour is already presente in master... where captureMessage are commented outhttps://github.com/ntegral/nestjs-sentry/blob/master/lib/sentry.service.ts#L64. But what I find strange is that this is a BC. Maybe it would need a major version not a patch. — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#42 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADEYTTNLNUD3KP5R4UP6JWLTX375XANCNFSM46LSWW4A.

@ntegral May I ask why did you rollback this change? I don't understand why would anybody want to capture and send everything to Sentry. It doesn't make sense at all. Every single .log() call gets converted into a Sentry event and gets published. image

How's that even useful? non-error messages should be stored as breadcrumbs in the current scope. https://docs.sentry.io/platforms/node/enriching-events/breadcrumbs/

empz avatar Aug 13 '21 14:08 empz

This will be included as an optional flag... That way it will not disrupt the current users of the package

ntegral avatar Aug 19 '21 18:08 ntegral

@ntegral Anything I can do to help get this merged? It would be a huge upgrade to me — at the moment my Sentry instance is filled with unhelpful and irrelevant issues from verbose and log events.

benbarbersmith avatar Oct 25 '21 11:10 benbarbersmith

Based off the above message by @ntegral ...

This has been corrected.. This will get rolled into 3.0.0 as the option to send as breadcrumb or message.

Apparently it was to be rolled into 3.0.0? Was that the case? If so then we can opt in for breadcrumbs and therefore obviously the PR is redundant (attn: @benbarbersmith).

If not... would love to see this merged ASAP because it massively reduces noise and improves the effectiveness of using Sentry as a tool to diagnose and identify issues in a NestJS app.

rbutera avatar Oct 26 '21 00:10 rbutera

:/ seems to not be part of 3.0.6 @ntegral

wodka avatar Nov 15 '21 14:11 wodka

Simple fix to not clutter your sentry. Add this to the sentry init or factory configuration.

beforeSend: (event) => {
  if ([Severity.Log, Severity.Info].includes(event.level)) {
    return null;
  } else {
    return event;
  }
},

TheSlimvReal avatar Jan 25 '22 14:01 TheSlimvReal