-
Notifications
You must be signed in to change notification settings - Fork 600
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 elasticsearch instrumentation #1525
Conversation
* Change the naming of the instrumentation method from _with_tracing to _with_new_relic * Add alias for renaming the original method * Add yield to instrumented method
The template was missing the reflection of the alias method to rename the original :perform_request method
The condition previously used ::Elastic, this caused a load error for Elasticsearch 7.x
This first pass at the data segment finds dynamic values for some attributes and hard codes others. This misses any reporting on the arguments passed to perform_request We should find a way to include those arguments in the segment
cluster_name request
This commit adds the ability to capture queries and optionally obfuscate them and add some associated tests
Other datastore segments notice the queries instead of adding them as attributes this change follows that pattern
1f47acb
to
00d2d01
Compare
use port 9200 for elastic 7 and 9250 for elastic 8
rather than checking for is ::Elastic is defined, we check for the gem version to decide which to use
changed the check to version of elasticsearch gem
…ic/newrelic-ruby-agent into add_elasticsearch_instrumentation
…ic/newrelic-ruby-agent into add_elasticsearch_instrumentation
lib/new_relic/agent/instrumentation/elasticsearch/instrumentation.rb
Outdated
Show resolved
Hide resolved
…ion.rb Co-authored-by: James Bunch <[email protected]>
…ic/newrelic-ruby-agent into add_elasticsearch_instrumentation
@segment = txn.segments[1] | ||
end | ||
|
||
# TODO! TEST METRIC GENERATION!!! |
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.
I think this TODO has either been satisfied or can be tracked elsewhere outside of the code now.
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.
All of my new questions / concerns for the stuff I hadn't yet synced up with you on from before have now been addressed. The instrumentation itself is still looking great and I'm excited to get it out into users' hands. Great work!
…ion.rb Co-authored-by: James Bunch <[email protected]>
…namically Set Elasticsearch operation dynamically
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.
Hooray for new instrumentation! Thanks for your leadership, Tanna!
SimpleCov Report
|
Before contributing, please read our contributing guidelines and code of conduct.
Overview
Adds instrumentation for the elasticsearch gem 7.0+.
Also updates the docker-compose file and the CI to run elasticsearch 7 and 8 to support our tests.
The Mongo sql obfuscator was moved to be used more generally for nosql obfuscation.
New configuration options:
instrumentation.elasticsearch
elasticsearch.capture_queries
elasticsearch.obfuscate_queries
Submitter Checklist:
Testing
The agent includes a suite of unit and functional tests which should be used to
verify your changes don't break existing functionality. These tests will run with
GitHub Actions when a pull request is made. More details on running the tests locally can be found
here for our unit tests,
and here for our functional tests.
For most contributions it is strongly recommended to add additional tests which
exercise your changes.
Reviewer Checklist