elixir-error-tracker / error-tracker

🐛 An Elixir-based built-in error reporting and tracking solution
https://hex.pm/packages/error_tracker
Apache License 2.0
327 stars 13 forks source link

Missing exceptions raised in LiveComponents #73

Closed numso closed 2 weeks ago

numso commented 2 weeks ago

I recently noticed a couple of exceptions in my app's logs that aren't showing up in ErrorTracker. I suspect it is because these exceptions originate from a LiveComponent.

The LiveView Telemetry documentation mentions that they also emit these telemetry events for components:

[:phoenix, :live_component, :update, :start]
[:phoenix, :live_component, :update, :exception]
[:phoenix, :live_component, :handle_event, :start]
[:phoenix, :live_component, :handle_event, :exception]

Looks like this project is missing those and only subscribes to [:phoenix, :live_view, *] events:

https://github.com/elixir-error-tracker/error-tracker/blob/720470ca5f32db6bcbca9d58cfad2698eeff70be/lib/error_tracker/integrations/phoenix.ex#L56-L63

I'm happy to attempt a PR if we want this change in the project.

crbelaus commented 2 weeks ago

Good catch! Feel free to open a PR so we can attach to those telemetry events.