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.
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
Auto Enable All Instrumentation Feature #1260
Auto Enable All Instrumentation Feature #1260
Changes from 8 commits
53c36d0
39c8f5d
644dba2
1af7b0d
de481a0
7918d49
6586217
36f6a91
f45cc9e
2dfdb14
a562e99
e28c90f
49e8e35
6d6a627
9bdc7c7
a4ec733
d07c6e5
92f4c9d
8347797
551735d
abd8752
2fe0339
2585ee0
f02d9b9
7c83169
39d7967
b70210f
7ff49cc
28c0da0
168cb97
3626e2d
b917f88
caff3cd
5c35252
7c412f4
dfab8a5
7bbc890
dcd5b49
1f036eb
0c55dda
79f8f9b
c38116f
916d5ca
a7b7420
33defed
b08df89
013f1dd
52be987
35c8e6b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Should we not say here "Auto Instrument All Integrations". That's a bit wordy and inconsistent with how we describe in other languages. Maybe just "Automatic Instrumentation" and "Manual Instrumentation"
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.
It reads much better with your suggestion, probably an oversight on our side here. I'll make these changes. 🙇 @andrewsouthard1
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.
If we add a new Rails integration or new test integration, and forget to add them here, I don't think any tests would fail today.
I don't have a strong preference on what approach to take, but I think we should ensure that, when a new integration is added, either by us or community, there should be no surprises with
AutoInstrument
with the integration addition.I can see this being done in different ways:
Datadog::Contrib::Patchable::ClassMethods
or similar).contrib
files added in an integration PR, but still a valid solution.Like I said, I have no strong preference here, but I think we should address this concern.
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.
yea, makes sense. I tend to think
Having integrations declare that they are allowed to be automatically activated (probably through a new field in Datadog::Contrib::Patchable::ClassMethods or similar).
is the right approach here, as therails + test libraries
non-auto-instrumentation logic is pretty arbitrary, and i'd rather this just be declared on a per integration basis explicitly. i'll add thisThere 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.
I added a
auto_instrument?
method toPatchable::InstanceMethods
that accomplishes this. It's a bit tricky to define the logic for the rails sub-modules (or those auto-enabled by rails), since they behave differently depending on whether rails/railtie is present. But i've added some helpers here to get this to work and think it' much cleaner nowThere 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.
one tradeoff here is that this PR is now quite a bit bigger but mostly it's adding boilerplate/repetitive methods to integration / integration_spec files. for your own sanity:
auto_instrument?
related changes tointegration/integration_spec.rb
files for a "rails-y" integration (like, active_record) is the same as all other "rails-y" integrations,cucumber / rspec
are changes identical,