-
Notifications
You must be signed in to change notification settings - Fork 375
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 instrumentation patch metrics #871
Conversation
7caf121
to
a2dc440
Compare
89386fd
to
0f99b5e
Compare
a2dc440
to
4873288
Compare
4873288
to
7355d4c
Compare
This is now ready for review. I think this is fine as is, but it might be worthwhile also adding a "gem version" tag to the metric of the library that failed to patch. e.g. If our Rails integration failed to patch Rails 6.1, it would add a |
base.send(:include, InstanceMethods) | ||
|
||
base.singleton_class.send(:prepend, CommonMethods) | ||
base.send(:prepend, CommonMethods) if base.class == Class |
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.
Any particular reason for handling the case where the Patcher is a class, given all our current Patchers are modules?
Would it be for future proofing?
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.
Yeah, technically our integration API doesn't require all patchers to be modules, just that they include Datadog::Contrib::Patcher
and behave like one. This means users who have created custom integrations might have implemented the patchers as classes: it's more of a "avoiding possible breaking change" thing than future proofing.
de3616c
to
280b180
Compare
Added |
f3e84d8
to
c11f784
Compare
As a further extension of #867, this pull request refactors how integration patching works, and adds a metric for whenever integration patching succeeds/fails.
New metrics include:
Datadog::Contrib::Patcher#patch
succeeds.Datadog::Contrib::Patcher#patch
raises an error.