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

Detect Elasticsearch version to handle doc_type appropriately #10342

Closed
spencergilbert opened this issue Dec 8, 2021 · 6 comments · Fixed by #14918 or #15082
Closed

Detect Elasticsearch version to handle doc_type appropriately #10342

spencergilbert opened this issue Dec 8, 2021 · 6 comments · Fixed by #14918 or #15082
Labels
sink: elasticsearch Anything `elasticsearch` sink related type: enhancement A value-adding code change that enhances its existing functionality.

Comments

@spencergilbert
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Based on discussion from #9970 it would be a nicer user experience for Vector to detect Elasticsearch's version and appropriately handle the type name. Example from fluentd

@spencergilbert spencergilbert added sink: elasticsearch Anything `elasticsearch` sink related type: enhancement A value-adding code change that enhances its existing functionality. labels Dec 8, 2021
@StephenWakely
Copy link
Contributor

As per the comment here the api is not always authorized. We may need to provide a fallback config option to specify the version.

@ktff
Copy link
Contributor

ktff commented Oct 19, 2022

It's possible to detect the version at startup as mentioned in #13881 (comment), else fallback to configured version, else error during build if version isn't configured.

@jszwedko
Copy link
Member

It's possible to detect the version at startup as mentioned in #13881 (comment), else fallback to configured version, else error during build if version isn't configured.

My thought is similar, but slightly different: let users configure whether to use auto detection or a static version like:

api_version: auto | v7 | v8

If they configure auto and the detection fails then Vector should halt. Typically I imagine users will want to configure a specific API version.

@ktff
Copy link
Contributor

ktff commented Oct 20, 2022

So a full proposal would be:

  • Add option api_version: auto | v6 | v7 | v8 which can be expanded with v9 | v10 ... as they come. Also this can be expanded with v1 | v2 | v5 if the sink supports them.
  • Deprecate suppress_type_name.
  • On auto, detect ES version on build. If it fails, return error that can halt Vector. Although this could cause reload to shutdown Vector in one case, considering that it's not common and that it's avoidable by setting exact version this seems to be acceptable.

@jszwedko
Copy link
Member

Yep! That is my thought.

@jszwedko
Copy link
Member

jszwedko commented Oct 29, 2022

Re-opening since we had to temporarily revert PR in #15006.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sink: elasticsearch Anything `elasticsearch` sink related type: enhancement A value-adding code change that enhances its existing functionality.
Projects
None yet
4 participants