-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Add ability to redirect ingestion failures on data streams to a failure store #126973
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
Merged
jbaiera
merged 18 commits into
elastic:main
from
jbaiera:failure-store-feature-flag-removal
Apr 18, 2025
Merged
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8222e76
Remove feature flag from prod code
jbaiera 56a7989
Remove feature flag from xpack main code
jbaiera efed960
Remove feature flag from test code
jbaiera f9ff7cc
Remove feature flag from test cluster configs
jbaiera d312f39
Set rest spec to stable/public
jbaiera 0b84f0d
Cleanup and precommit
jbaiera 40fe4c0
Remove last references to flag and flag itself
jbaiera 2b0c91b
Remove dev feature guard from ESQL antlr files
jbaiera 71919f1
Update docs/changelog/126973.yaml
jbaiera da6fd85
Update docs/changelog/126973.yaml
jbaiera bb6f9e5
Fix changelog
jbaiera adb14b1
Merge branch 'main' into failure-store-feature-flag-removal
elasticmachine 762ea7e
Merge branch 'main' into failure-store-feature-flag-removal
elasticmachine 63f275e
Merge branch 'main' into failure-store-feature-flag-removal
elasticmachine 3d492d0
Update docs/changelog/126973.yaml
jbaiera a3207ff
Clean up DataStream serialization
jbaiera 82a7458
Merge branch 'main' into failure-store-feature-flag-removal
jbaiera 5b20486
Fix merge issues
jbaiera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| pr: 126973 | ||
| summary: Add ability to redirect ingestion failures on data streams to a failure store | ||
| area: Data streams | ||
| type: feature | ||
| issues: [] | ||
| highlight: | ||
| title: Add ability to redirect ingestion failures on data streams to a failure store | ||
| body: |- | ||
| Documents that encountered ingest pipeline failures or mapping conflicts | ||
| would previously be returned to the client as errors in the bulk and | ||
| index operations. Many client applications are not equipped to respond | ||
| to these failures. This leads to the failed documents often being | ||
| dropped by the client which cannot hold the broken documents | ||
| indefinitely. In many end user workloads, these failed documents | ||
| represent events that could be critical signals for observability or | ||
| security use cases. | ||
|
|
||
| To help mitigate this problem, data streams now maintain a "failure | ||
| store" which is used to accept and hold documents that fail to be | ||
| ingested due to preventable configuration errors. The data stream's | ||
| failure store operates like a separate set of backing indices with their | ||
| own mappings and access patterns that allow Elasticsearch to accept | ||
| documents that would otherwise be rejected due to unhandled ingest | ||
| pipeline exceptions or mapping conflicts. | ||
|
|
||
| Users can enable redirection of ingest failures to the failure store on | ||
| new data streams by specifying it in the new `data_stream_options` field | ||
| inside of a component or index template: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| PUT _index_template/my-template | ||
| { | ||
| "index_patterns": ["logs-test-*"], | ||
| "data_stream": {}, | ||
| "template": { | ||
| "data_stream_options": { | ||
| "failure_store": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| } | ||
| }' | ||
| ---- | ||
|
|
||
| Existing data streams can be configured with the new data stream | ||
| `_options` endpoint: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| PUT _data_stream/logs-test-apache/_options | ||
| { | ||
| "failure_store": { | ||
| "enabled": "true" | ||
| } | ||
| } | ||
| ---- | ||
|
|
||
| When redirection is enabled, any ingestion related failures will be | ||
| captured in the failure store if the cluster is able to, along with the | ||
| timestamp that the failure occurred, details about the error | ||
| encountered, and the document that could not be ingested. Since failure | ||
| stores are a kind of Elasticsearch index, we can search the data stream | ||
| for the failures that it has collected. The failures are not shown by | ||
| default as they are stored in different indices than the normal data | ||
| stream data. In order to retrieve the failures, we use the `_search` API | ||
| along with a new bit of index pattern syntax, the `::` selector. | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| POST logs-test-apache::failures/_search | ||
| ---- | ||
|
|
||
| This index syntax informs the search operation to target the indices in | ||
| its failure store instead of its backing indices. It can be mixed in a | ||
| number of ways with other index patterns to include their failure store | ||
| indices in the search operation: | ||
|
|
||
| [source,yaml] | ||
| ---- | ||
| POST logs-*::failures/_search | ||
| POST logs-*,logs-*::failures/_search | ||
| POST *::failures/_search | ||
| POST _query | ||
| { | ||
| "query": "FROM my_data_stream*::failures" | ||
| } | ||
| ---- | ||
| notable: true | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.