Skip to content

Add telemetry #31

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

Merged
merged 3 commits into from
Apr 21, 2020
Merged

Add telemetry #31

merged 3 commits into from
Apr 21, 2020

Conversation

josevalim
Copy link
Member

Since we are nearing Phoenix v1.5 release, I think we should get this in before so we can apply similar changes to Phoenix.

It is very similar to @bryannaegele's PR with some changes:

  1. The conn is given to all events - although exception emits a stale connection

  2. I have renamed the event to [:plug_adapter, :call, :start]. This is based on our previous discussions. Since I want this event to be generic in regards to the adapter, then I think it is best to name it based on Plug's contract. In other words, this event is triggered when the adapter calls the underlying Plug. For this reason, I am also passing the called plug as metadata.

Please review it ASAP so I can apply these changes to Phoenix.

/cc @GregMefford @binaryseed @bryannaegele

Copy link

@GregMefford GregMefford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

My only question/concern is whether this would catch errors raised from Erlang libraries, or only Exceptions thrown from Elixir code. The behavior would be the same in the existing code but with these telemetry events, it’s more critical to handle all cases because it might be the main way that people see that an error happened. I’m not at a computer to check ATM.

@josevalim
Copy link
Member Author

@GregMefford it handles both. catch is not specific to Elixir.

Copy link

@bryannaegele bryannaegele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for taking up the torch.

@binaryseed
Copy link
Contributor

Third time's a charm! looks great

Previous PRs:

@josevalim josevalim merged commit 52958f5 into master Apr 21, 2020
@josevalim
Copy link
Member Author

💚 💙 💜 💛 ❤️

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

Successfully merging this pull request may close these issues.

4 participants