feat(elasticsearch): support elasticsearch 8
Description
This change is required because newer versions of elasticsearch have the Transport class in a different location.
Fixes https://github.com/DataDog/dd-trace-py/issues/3482
Checklist
- [x] Title must conform to conventional commit.
- [x] Add additional sections for
featandfixpull requests. - [ ] Ensure tests are passing for affected code.
- [ ] Library documentation and/or Datadog's documentation site is updated. Link to doc PR in description.
Motivation
Since newer versions of elasticsearch contain the Transport class on elastic_transport._transport, the patching mechanism needs to use this new location instead of the older versions location.
Design
This change is backwards compatible and I don't see a major drawback.
Testing strategy
The riot testing suite has been expanded with new versions of elasticsearch.
Reviewer Checklist
- [ ] Title is accurate.
- [ ] Description motivates each change.
- [ ] No unnecessary changes were introduced in this PR.
- [ ] PR cannot be broken up into smaller PRs.
- [ ] Avoid breaking API changes unless absolutely necessary.
- [ ] Tests provided or description of manual testing performed is included in the code or PR.
- [ ] Release note has been added for fixes and features, or else
changelog/no-changeloglabel added. - [ ] All relevant GitHub issues are correctly linked.
- [ ] Backports are identified and tagged with Mergifyio.
- [ ] Add to milestone.
It also looks like the arguments for Elasticsearch() class have changed?
https://app.circleci.com/pipelines/github/DataDog/dd-trace-py/20755/workflows/172ff6c2-fa41-4d2c-bd01-d6845817c353/jobs/1407429
It also looks like the arguments for
Elasticsearch()class have changed?https://app.circleci.com/pipelines/github/DataDog/dd-trace-py/20755/workflows/172ff6c2-fa41-4d2c-bd01-d6845817c353/jobs/1407429
A lot of things seem to have changed in elasticsearch 8. Unfortunately I had to make a lot of code on the tests check the elasticsearch version.
I have noticed that circle CI tests are failing on the elasticsearch 8 code path , but they are working correctly for me if I use an elasticsearch 8 instance running on port 9200. It seems to be an environment issue on your end.
I also don't understand why circle CI build docs is failing, where are the spelling errors?
If anyone could help me to finish this and get this shipped, it would be much appreciated.
Given the low activity and conflicts I am going to close this PR.
elasticsearch8 is something we want to support, but we do not have the bandwidth to update this PR at this time.
Please feel free to resolve the conflicts and re-open the PR!