-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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/elasticsearch] add support for batcher
config
#34238
Merged
mx-psi
merged 7 commits into
open-telemetry:main
from
axw:elasticsearch-sync-bulkindexer
Jul 30, 2024
Merged
[exporter/elasticsearch] add support for batcher
config
#34238
mx-psi
merged 7 commits into
open-telemetry:main
from
axw:elasticsearch-sync-bulkindexer
Jul 30, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add opt-in support for the experimental batcher helper - open-telemetry/opentelemetry-collector#8122 When opting into this functionality the exporter's Consume* methods will make synchronous bulk requests to Elasticsearch, without additional batching/buffering in the exporter.
carsonip
reviewed
Jul 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks! looks great at a high level
Apparently the backoff function is stateful, as can be seen from the data races in the tests. Working on a fix. |
Co-authored-by: Carson Ip <carsonip@users.noreply.github.com>
carsonip
approved these changes
Jul 25, 2024
mwear
approved these changes
Jul 25, 2024
This was referenced Aug 14, 2024
dmitryax
added a commit
to open-telemetry/opentelemetry-collector
that referenced
this pull request
Aug 17, 2024
#### Description This PR adds opt-in support to oltp exporter for the experimental batch sender (#8122). By default batch sender is not enabled. Similar: * open-telemetry/opentelemetry-collector-contrib#34238 * open-telemetry/opentelemetry-collector-contrib#32563 #### Link to tracking issue Resolves #10834 #### Testing `exporter/otlpexporter/config_test.go` #### Documentation Updated the `oltpexporter` README to point to `exporterhelper` README for batching. --------- Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Add opt-in support for the experimental batch sender (open-telemetry/opentelemetry-collector#8122). When opting into this functionality the exporter's
Consume*
methods will make synchronous bulk requests to Elasticsearch, without additional batching/buffering in the exporter.By default the exporter continues to use its own buffering, which supports thresholds for time, number of documents, and size of encoded documents in bytes. The batch sender does not currently support a bytes-based threshold, and is experimental, hence why we are not yet making it the default for the Elasticsearch exporter.
This PR is based on #32632, but made to be non-breaking.
Link to tracking Issue:
#32377
Testing:
Added unit and integration tests.
Manually tested with Elasticsearch, using the following config to highlight that client metadata can now flow through all the way:
I have Elasticsearch running locally, with an "admin" user with the password "changeme". Sending OTLP/HTTP to the collector with
telemetrygen traces --otlp-http --otlp-insecure http://localhost:4318 --otlp-header "Authorization=\"Basic YWRtaW46Y2hhbmdlbWU=\""
, I observe the following:batcher
config, the exporter fails to index data into Elasticsearch due to an auth error. That's because the exporter is buffering and dropping the context with client metadata, so there's no Authorization header attached to the requests going out.batcher: {enabled: true}
, same behaviour as above. Unlike thebatch
processor, the batch sender does not maintain client metadata.batcher: {enabled: false}
, the exporter successfully indexes data into Elasticsearch.Documentation:
Updated the README.