heiseonline / perl-sentry-sdk

Other
8 stars 6 forks source link

Disable reporting if DSN is not set #27

Closed mbudde closed 1 week ago

pmb0 commented 1 week ago

Thanks!

rabbiveesh commented 2 days ago

hey, the change to sample breaks existing code really badly - anything that created a transaction now suddenly gets undef during testing. One of the commits in #30 fixes this. Unless i'm not understanding something, it never tried reporting anything when there's no dsn; i've been using this for years and in tests i have no DSN and everything is hunky-dory.

rabbiveesh commented 2 days ago

In fact, i had already written this behavior in #6 ; what wasn't working about that?

mbudde commented 1 day ago

In fact, i had already written this behavior in #6 ; what wasn't working about that?

The motivation is having a way to completely disable Sentry::SDK (integrations should not be initialized) such that Sentry::SDK->capture_exeception et al are just no-ops and there are no potential side-effects (performance or bugs) from the integrations. But looking at the Python SDK it looks like it is handled by having a default no-op client before initialization and if an empty DSN is set the SDK is initialized but doesn't send events. That might be a better way to do it.

rabbiveesh commented 1 day ago

Oh, so then this is the wrong thing to do b/c this breaks any integration that was starting a transaction. If you wanna disable the integrations, then just don't always load them. in #31 I implement this (it matches better to other SDKs where there's a defaultIntegrations function exported)