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

[Exporter/OpenSearch] OpenSearch exporter setup #23819

Merged

Conversation

MitchellGale
Copy link
Contributor

@MitchellGale MitchellGale commented Jun 28, 2023

Description:
Adding initial set-up for OpenSearch exporter addition. Future PRs will include adding functionality to the exporter, code coverage and e2e tests.

Broken up for easier review.

New component proposal.

Link to tracking Issue:
Start of resolution of #7905.

Testing:
Will come in future PR to 80+% coverage.

Break-up of #23045

@MitchellGale MitchellGale requested review from a team and songy23 June 28, 2023 21:16
@github-actions github-actions bot added the cmd/otelcontribcol otelcontribcol command label Jun 28, 2023
@codeboten
Copy link
Contributor

Pinging @Aneurysm9 for the initial review

@songy23 songy23 requested a review from Aneurysm9 June 28, 2023 23:20
@MitchellGale MitchellGale changed the title OpenSearch exporter setup [Exporter/OpenSearch] OpenSearch exporter setup Jun 29, 2023
cmd/otelcontribcol/builder-config.yaml Outdated Show resolved Hide resolved
exporter/opensearchexporter/config.go Show resolved Hide resolved
exporter/opensearchexporter/factory.go Outdated Show resolved Hide resolved
@MitchellGale MitchellGale force-pushed the Integ/OpenSearchExporter-setup branch from 943e2c1 to 993ce1a Compare July 5, 2023 22:48
.github/dependabot.yml Outdated Show resolved Hide resolved
exporter/opensearchexporter/README.md Outdated Show resolved Hide resolved
exporter/opensearchexporter/README.md Outdated Show resolved Hide resolved
exporter/opensearchexporter/README.md Outdated Show resolved Hide resolved
exporter/opensearchexporter/README.md Outdated Show resolved Hide resolved
- `flush`: Event bulk buffer flush settings
- `bytes` (default=5242880): Write buffer flush limit.
- `interval` (default=30s): Write buffer time limit.
- `retry`: Event retry settings
Copy link
Member

Choose a reason for hiding this comment

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

This should probably use the exporterhelper.RetrySettings type to provide consistency of configuration across exporters.

Copy link
Contributor

Choose a reason for hiding this comment

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

These values are used to create a backoff function for the OpenSearch client.
We'll check if exporterhelper.RetrySettings can be used here.

Copy link
Contributor

Choose a reason for hiding this comment

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

The config struct can be changed to use exporterhelper.RetrySettings but the implied behaviour may be different.

exporterhelper.WithRetry retries a batch of trace records, right? OpenSearch supports retrying one failed document from a bulk indexing request.

Would it be more appropriate to log documents that OpenSearch failed to index and move on? Currently they are added back to the bulk indexer queue to be tried later.

Copy link
Member

@Aneurysm9 Aneurysm9 Jul 21, 2023

Choose a reason for hiding this comment

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

You can use the consumererror.Traces type to return an error containing the spans that failed to export. The exporterhelper error handler will unwrap the error, extract the spans, and replace the request with one containing just the failed spans.

exporter/opensearchexporter/README.md Outdated Show resolved Hide resolved
exporter/opensearchexporter/README.md Outdated Show resolved Hide resolved
exporter/opensearchexporter/factory.go Outdated Show resolved Hide resolved
@MaxKsyunz MaxKsyunz deleted the Integ/OpenSearchExporter-setup branch July 14, 2023 03:15
@MaxKsyunz
Copy link
Contributor

@Aneurysm9 based on your feedback and how opensearch-go client is set up, I'd like to do the following:

  1. Use HTTPClientSettings in exporter's configuration. Map these settings to opensearch-go client's config.
  2. Limit OpenSearch client to one BulkIndexer worker. A worker will be created and shut down for each batch of trace data.
  3. Use RetrySettings but retry only if the whole batch fails.

This way the exporter will not use internal queue management done by opensearch-go and use existing opentel-collector data structures and code where possible.

What do you think?

Remove exporter-specific settings and use confighttp.HTTPClientSettings and exporterhelper.RetrySettings

Update README to reflect the above.

Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
Copy link
Member

@Aneurysm9 Aneurysm9 left a comment

Choose a reason for hiding this comment

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

LGTM.

I've still got some questions around the retry and authN logic, but I think we can deal with those on the implementation PRs when they're more concrete conversations.

Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
@MaxKsyunz MaxKsyunz force-pushed the Integ/OpenSearchExporter-setup branch from 53a36a5 to a2ed3e8 Compare July 21, 2023 00:35
# Conflicts:
#	.github/dependabot.yml
dependabot.yml reached maximum limit so a package is getting dropped but CI will fail without this change.

See open-telemetry#19410

Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
@MaxKsyunz
Copy link
Contributor

GHAs failed on a known flaky test. See #21094

Is there a way to re-run it?

@Aneurysm9 Aneurysm9 added the ready to merge Code review completed; ready to merge by maintainers label Jul 21, 2023
@codeboten codeboten merged commit 675710d into open-telemetry:main Jul 21, 2023
@github-actions github-actions bot added this to the next release milestone Jul 21, 2023
@fullammo
Copy link

Hi! can we enable this exporter for logs as well?

@steevex35
Copy link

Hi!
This exporter can be used for logs ?
the OpensearchExporter readme.md mentions only trace pipeline.
thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/otelcontribcol otelcontribcol command ready to merge Code review completed; ready to merge by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants