-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
use PhoenixProfiler on the Endpoint #58
base: main
Are you sure you want to change the base?
Conversation
* main: Fix package deps Release v0.1.0 Recommend profiler on telemetry supervision tree Add a Changelog
%Profile{data: %{metrics: metrics}} = profile | ||
|
||
socket = | ||
case profile.data[:exception] do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like there's a race condition here, the toolbar is mounted before telemetry has a chance to collect the event [:phoenix_profiler, :endpoint, :exception]
so profile.data[:exception]
is always null at this point.
I'm assuming that http://localhost:4000/errors/assign-not-available should populate @exits
considering
telemetry_execute(:exception, %{duration: duration(start_time)}, %{ |
{:keep, %{exception: Map.take(meta, [:kind, :reason, :stacktrace])}} |
@leandrocp You are correct– the toolbar cannot render the error for its own request because the I think you are also correct about the race condition tho– we are racing the late write to ETS and that's why we are getting back profile data without the exception. But now I think I have an idea of how to get the tests passing, stand by! :) |
The endpoint integration tests are racing the late collection behaviour in the profiler endpoint, which sometimes results in tests failing due to receiving outdated profile information. We are attempting to correct this by fetching the profile data by its token thru another endpoint request. Hopefully this will slow things down enough to give the late write a much better chance to finish before the data is requested. In practice this isn't an actual problem, as in most cases (like the Dashboard) we poll for updated information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mcrumm just tested this PR on a real project and it looks good to me 👍🏻
@leandrocp Thanks for testing it out! Yes, things seem to work fine but the Heisenbugs are forcing me to question some earlier decisions. I just had a nice chat with @elbow-jason who gave me some ideas that I hope to experiment with soon! :) |
No description provided.