Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a debug mode and capture unhandled events in debug mode #129

Open
ding-an-sich opened this issue Apr 15, 2023 · 2 comments
Open

Comments

@ding-an-sich
Copy link

ding-an-sich commented Apr 15, 2023

It would be useful to debug poorly configured handlers or having the list of all events emitted in an application.

I initially thought about always persisting unhandled events to an ETS table, but I realize that the execute function could be called many times per second so we need to keep the overhead there to a minimum.

So I was thinking of doing it conditionally if the telemetry application is run in debug mode.

For now we could keep things simple and only persist unhandled event names.

Later we could expand the debug mode to do things that are no-nos when running in production.

The downside of this approach is that right now telemetry is so simple that it doesn't need configuration (and that is a good thing) and a debug mode would make it slightly more complex. It also means a possible foot gun for users that could unwittingly set debug mode on production.

@josevalim
Copy link
Contributor

The problem with this is that it would make all handlers today more expensive, because now they need to check if there is a debug mode. The only way to avoid this would be to dynamically compile it with debug mode but I think that it would virtually make it useless. :(

@bryannaegele
Copy link
Contributor

bryannaegele commented Apr 16, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants