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

fix[elasticsearch output]: add scheme to fix error in sniffing option #10513

Merged
merged 6 commits into from
Feb 3, 2022

Conversation

zpriddy
Copy link
Contributor

@zpriddy zpriddy commented Jan 24, 2022

  • [ N/A ] Updated associated README.md.
  • [ N/A ] Wrote appropriate unit tests.
  • Pull request title or commits are in conventional commit format

resolves #10512

Set an elasticsearch configuration for elastic.SetScheme() matching the URL scheme from the first elastic address set in URLs. This enables the sniffing to search with the proper scheme for https:// otherwise it will default to http://

We have an upstream issue opened as it seems like this should be done automatically with the elasticsearch plugin.. However currently it requires it to be configured when calling the plugin.

olivere/elastic#1569

Add the scheme from the first elastic URL passed in and derive the scheme to ensure that sniffing is successful
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Hey @zpriddy, thanks for tackling this issue! I have a minor comment and a question regarding scheme collection. To me using the first URL is not the best approch as it might leave you with only one possible not out of your set if, by chance, the first node is "special". I have some suggestions in the code, please have a look...

plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this Jan 25, 2022
@srebhan srebhan added area/elasticsearch fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Jan 25, 2022
@zpriddy zpriddy requested a review from srebhan January 27, 2022 23:01
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

@zpriddy thanks for your quick response. The code looks good, I just put one more minor comment there, but I can also live with this being merged as-is.

plugins/outputs/elasticsearch/elasticsearch.go Outdated Show resolved Hide resolved
@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Jan 28, 2022
@srebhan
Copy link
Member

srebhan commented Jan 28, 2022

@zpriddy please resolve the merge conflict.

zpriddy and others added 2 commits January 28, 2022 09:57
Co-authored-by: Sven Rebhan <36194019+srebhan@users.noreply.github.com>
@powersj
Copy link
Contributor

powersj commented Jan 28, 2022

Hi,

Can you please run go mod tidy and push one last time? That should fix tests. Thanks!

@telegraf-tiger
Copy link
Contributor

@zpriddy zpriddy requested a review from srebhan January 31, 2022 18:27
Copy link
Member

@srebhan srebhan left a comment

Choose a reason for hiding this comment

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

Perfect. Thanks @zpriddy for working on this PR!

@srebhan srebhan added ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. and removed ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. labels Feb 1, 2022
@MyaLongmire MyaLongmire merged commit 5c8751f into influxdata:master Feb 3, 2022
powersj pushed a commit that referenced this pull request Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/elasticsearch fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Elasticsearch Sniffing Broken
5 participants