-
Notifications
You must be signed in to change notification settings - Fork 369
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
Improve controller instrumentation and deprecate option exception_controller
#2726
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was
linked to
issues
Mar 28, 2023
Closed
TonyCTHsu
force-pushed
the
tonycthsu/error_controller
branch
from
March 28, 2023 11:22
4176496
to
0ca80e4
Compare
TonyCTHsu
force-pushed
the
tonycthsu/error_controller
branch
from
March 28, 2023 12:26
9f5aacf
to
a09569d
Compare
TonyCTHsu
changed the title
Improve exception controller instrumentation
Improve trace resource assignment for controller instrumentation and deprecate option Mar 29, 2023
exception_controller
TonyCTHsu
changed the title
Improve trace resource assignment for controller instrumentation and deprecate option
Improve controller instrumentation and deprecate option Mar 29, 2023
exception_controller
exception_controller
marcotc
reviewed
Mar 29, 2023
lib/datadog/tracing/contrib/action_pack/configuration/settings.rb
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2726 +/- ##
==========================================
+ Coverage 98.06% 98.07% +0.01%
==========================================
Files 1210 1215 +5
Lines 66456 67025 +569
Branches 2972 2994 +22
==========================================
+ Hits 65172 65738 +566
- Misses 1284 1287 +3
... and 4 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
marcotc
approved these changes
Mar 30, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why?
This PR addresses issues (#2709 , #2611 , #2567) we've had for instrumenting an exception handling controller.
exception_controller
with constant does not work properly with zeitwerk autoloading.What?
After careful examination of the problem, I have concluded that the current behaviour of option
exception_controller
is bringing more harm than benefit, because of the fundamental problem to answer the question about what is the strategy to decide whether to overwrite trace resource?🚫 It should not be made by based on whether the current controller is handling the request being defined as an exceptional controller, since a request could be sent to the path directly (such case: overwrite trace resource).
✅ The decision should be made by whether an exception being redirected by
ActionDispatch::ShowException
.The changes are made to depend on the default behaviour for
ActionDispatch::ShowException
and make the optionexception_controller
obsolete. We decided to deprecate the option and no longer required to solve the problem with zeitwerk autoloading.We recommend our users to remove
exception_controller
option from the configuration.Snapshot of changes