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

feat: add support for OpenSearch to existing ElasticSearch output plugin #10390

Closed
wants to merge 5 commits into from

Conversation

pteich
Copy link

@pteich pteich commented Jan 6, 2022

Required for all PRs:

resolves #9414

This PR adds support for OpenSearch to the existing ElasticSearch output plugin. OpenSearch is based on ElasticSearch 7.x but it introduces its own versioning. Because of this the current version reports 1.2.3 and this breaks the version check implementation.

To make it work with OpenSearch servers this PR introduces a new config setting opensearch = true that circumvents the version check and internal treats the server as a major version 7 ElasticSearch (because this is needed for other internal checks).
The new config setting also enables to react to other potentially OpenSearch additions in the future.

@telegraf-tiger
Copy link
Contributor

telegraf-tiger bot commented Jan 6, 2022

Thanks so much for the pull request!
🤝 ✒️ Just a reminder that the CLA has not yet been signed, and we'll need it before merging. Please sign the CLA when you get a chance, then post a comment here saying !signed-cla

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Jan 6, 2022
@pteich
Copy link
Author

pteich commented Jan 6, 2022

!signed-cla

@StefanSa
Copy link

@pteich Peter,
there would be already an important pull request.
Please make sure that this new plugin also supports data stream, so bulk_action => create.

@pteich
Copy link
Author

pteich commented Jan 24, 2022

@StefanSa I'll have a look and also resolve the conflicts.

@StefanSa
Copy link

@pteich Peter,
details please look here:
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#docs-bulk-api-desc

Data streams support only the create action. To update or delete a document in a data stream, you must target the backing index containing the document. See Update or delete documents in a backing index.

Grüße nach Leipzig

* master: (117 commits)
  fix: bump github.com/nats-io/nats-server/v2 from 2.6.5 to 2.7.2 (influxdata#10638)
  chore: add -race flag to go tests (influxdata#10629)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10631)
  fix: license doc outdated causing CI failure (influxdata#10630)
  fix: bump k8s.io/client-go from 0.22.2 to 0.23.3 (influxdata#10589)
  feat: Implemented support for reading raw values, added tests and doc (influxdata#6501)
  fix: Improve parser tests by using go-cmp/cmp (influxdata#10497)
  feat(mongodb): add FsTotalSize and FsUsedSize informations (influxdata#10625)
  docs: update quay docs for auth (influxdata#10612)
  chore: allow downgrade of go version in windows script (influxdata#10614)
  chore: update CI go to 1.17.6 (influxdata#10611)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10600)
  fix(inputs.opcua): add more data to error log (influxdata#10465)
  fix: bump github.com/aws/aws-sdk-go-v2/service/kinesis from 1.6.0 to 1.13.0 (influxdata#10601)
  refactor: use early return pattern (influxdata#10591)
  fix: bump github.com/benbjohnson/clock from 1.1.0 to 1.3.0 (influxdata#10588)
  feat: add dynamic tagging to gnmi plugin (influxdata#7484)
  fix: bump github.com/Azure/azure-kusto-go from 0.5.0 to 0.5.2 (influxdata#10598)
  feat: update etc/telegraf.conf and etc/telegraf_windows.conf (influxdata#10584)
  fix(parsers.json_v2): allow optional paths and handle wrong paths correctly (influxdata#10468)
  ...

# Conflicts:
#	plugins/outputs/elasticsearch/elasticsearch.go
#	plugins/outputs/elasticsearch/elasticsearch_test.go
@powersj
Copy link
Contributor

powersj commented Feb 16, 2022

The team chatted about the way we wanted to fix this and instead put up #10586.

The PR documents the method that Amazon has given to enable compatibility with Elasticsearch clients. It is best if users use this method rather than trying to set options in Telegraf itself.

One of the reasons is we do not like to add boolean values due to potential conflicts in the future. For example, right now this PR would set the major version to 7. However, it is entirely possible that Amazon moves to Elasticsearch 8 or 9 in the future. If there are additional major version checks added in the future the boolean would have to know more about which version to use.

I appreciate that you took the time to put this up, but I am going to close it as we have landed the other PR.

Thanks

@powersj powersj closed this Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

elasticsearch output doesn't work with opensearch
3 participants