Closed WojciechRydel closed 1 year ago
We on Support have also gotten a request to throw an error when the DSN is missing or invalid.
I would like to add that it is not possible for a library user to determine whether the configuration is correct, even if a DSN is provided. The following snippet uses a fantasy DSN, but there is no indication, that the configuration is broken:
const Sentry = require('@sentry/node');
Sentry.init({
dsn: 'https://foobar@sentry.io/baz',
});
const errorId = Sentry.captureException(new Error('some error'));
console.dir({errorId})
Sentry.flush(1000)
.then(result => console.dir({result}))
.catch(error => console.dir({error}))
// Output:
// { errorId: '<someid>' }
// { result: true }
I understand that even if client code is able to detect a broken configuration it might be unable to report that error, since sentry is the very tool that is supposed to report errors.
That is why I would like to see a some kind of heart beat implemented. The client lib could send a heart beat when running and the sentry service could notify about missing heartbeats for a DSN. That would allow backend services to be certain that their sentry config is working.
Is there already such a heart beat system that I am unaware of?
That is why I would like to see a some kind of heart beat implemented. Is there already such a heart beat system that I am unaware of?
Not yet, but we have actively discussed it few times already. No clear conclusion yet though. Will update it here if we get more info.
Thanks for the quick reply. We would be very happy to see some solution soon.
Package + Version
@sentry/browser
@sentry/node
raven-js
raven-node
(raven for node)Version:
Description
There is a possibility to call
Sentry.init()
without any arguments/config. It would be great to be notify when one initilize the client without any configuration. Such behaviour also allow to execute e.g.Sentry.captureException(err)
without initializing the client - uuid is returned, but it would be nice to anError
be thrown when one calls such a method with Sentry client which has not been initialized.