Skip to content
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

contrib/olivere/elastic: Update tests to work with v7 #621

Closed
wants to merge 2 commits into from

Conversation

knusbaum
Copy link
Contributor

WIP to see if contrib/olivere/elastic will work with v7

@knusbaum knusbaum added this to the 1.23.0 milestone Mar 25, 2020
@@ -20,6 +20,7 @@ import (
"gopkg.in/DataDog/dd-trace-go.v1/internal/globalconfig"
elasticv3 "gopkg.in/olivere/elastic.v3"
elasticv5 "gopkg.in/olivere/elastic.v5"
elasticv7 "gopkg.in/olivere/elastic.v7"
Copy link
Contributor

@gbbr gbbr Mar 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? If so - weird. They might've simply forgotten to add import path checking because their README shows the import path github.com/olivere/elastic/v7. It's also the import path that's used throughout the repository.

I wouldn't do this to be frank.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I can get rid of this and close the PR. I was hoping we could add some tests to prove this works with elastic v7 client. I think it actually does from my experimentation.

Even though v7 requires the use of modules, users should still be able to use the integration with it. Our tracer can be used in projects using modules, we just can't import versioned packages into the tracer. For this particular integration, we only import the library into the tests. For the integration code itself we just provide a traced http client to be configured with the elasticsearch client:
https://github.com/DataDog/dd-trace-go/blob/v1/contrib/olivere/elastic/elastictrace.go#L28

This looks like it's still possible with v7, since the SetHttpClient option is still present.
We just won't be able to add tests since we can't safely import the new client.

@knusbaum
Copy link
Contributor Author

Closing for now. We can't test v7 until we support modules. (#471)

@knusbaum knusbaum closed this Mar 26, 2020
@knusbaum knusbaum modified the milestones: 1.23.0, Unplanned Apr 2, 2020
@knusbaum knusbaum deleted the knusbaum/olivere-elastic-v7 branch May 15, 2020 13:16
@knusbaum knusbaum removed this from the Triage milestone May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants