-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Add context.HandlerNames() #1729
Conversation
This change adds a HandlerNames method that will return all registered handles in the context, in descending order This is useful for debugging and troubleshooting purposes, especially in large apps
Codecov Report
@@ Coverage Diff @@
## master #1729 +/- ##
==========================================
+ Coverage 98.49% 98.49% +<.01%
==========================================
Files 41 41
Lines 2054 2059 +5
==========================================
+ Hits 2023 2028 +5
Misses 19 19
Partials 12 12
Continue to review full report at Codecov.
|
when use |
Hi @thinkerou! at work we have dozens of large services which include both ad-hoc middlewares and base ones which come from an internal framework that dynamicly injects metrics and infrastructure related middlewares upon app initialization In some cases and during testing, problems may arise due to invalid or wrong configurations on containers that result in different middleware pipelines being applied to those instances. In one specific case, we had an unhandled panic on a goroutine that was bringing down the service, and this helped to discard configuration issues on both the app server and the framework configuration (we've had those in the past) before I moved on to review the affected service implementation tl;dr: It's useful to dump all the active handlers when diagnosing production issues |
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.
Thanks! LGTM.
This PR adds a HandlerNames method which returns all registered handles for the context in descending order