Update elastic search spy to check for new gem name#1257
Update elastic search spy to check for new gem name#1257jaggederest merged 5 commits intoelastic:mainfrom jaggederest:elastic_transport_spy
Conversation
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Test errors
Expand to view the tests failures
|
🌐 Coverage report
|
estolfo
left a comment
There was a problem hiding this comment.
I think we should keep this PR to fixing the elastisearch client instrumentation. Then, let's open a separate PR to resolve the other test failures (sneakers version and json seg fault)
|
|
||
| def install | ||
| ::Elasticsearch::Transport::Client.prepend(Ext) | ||
| if defined?(::ElasticSearch::Transport::Client) |
There was a problem hiding this comment.
Why do we have this condition and clause?
There was a problem hiding this comment.
There are 3 different constants in use through the versions of elastic transport ruby - Elastic::Transport is the current one, the older one is ElasticSearch::Transport, and the oldest one is Elasticsearch::Transport. So this if statement makes sure we instrument the correct one of those three, based on which one is defined. I should probably make it Elastic::Transport first, now that I think about it 👍
There was a problem hiding this comment.
Where did you find that it was ElasticSearch previously?
There was a problem hiding this comment.
Huh, maybe it wasn't. That was just the constant I used when I fixed the test errors. I will remove it and if it doesn't cause any additional test errors, no harm no foul I guess.
|
|
||
| def install | ||
| ::Elasticsearch::Transport::Client.prepend(Ext) | ||
| if defined?(::ElasticSearch::Transport::Client) |
There was a problem hiding this comment.
There are 3 different constants in use through the versions of elastic transport ruby - Elastic::Transport is the current one, the older one is ElasticSearch::Transport, and the oldest one is Elasticsearch::Transport. So this if statement makes sure we instrument the correct one of those three, based on which one is defined. I should probably make it Elastic::Transport first, now that I think about it 👍
|
@estolfo This PR should be ready for re-review, thanks for reviewing it! |
* Update elastic search spy to check for new gem name * Update changelog for pr #1257 * Fix case where we are using older version of elasticsearch-transport (pre 2.5) * Omit extra bundler install in scripts/spec * Remove erroneous ElasticSearch constant check
What does this pull request do?
There is an error in the tests, and likely no data being captured, with the new elasticsearch-ruby gem. This fixes that issue.
Why is it important?
elasticsearch-ruby relies on a separate gem to provide transport functionality, and that gem is what we instrument. Last year, in preparation for the 8.0 release, that gem was renamed and separated from the core elasticsearch-ruby repo into a new repo, and renamed elastic-transport. Our spy still works, but it was no longer checking the right dependency name to install itself, and therefore was not capturing data correctly.
Checklist
.rubocop.yml)Related issues