fix(streams): update default_pipeline on write index when adding processing to a second OTEL metrics stream#269988
Conversation
c4d1bd0 to
48721eb
Compare
…essing to a second OTEL metrics stream When a second classic stream sharing the same template-level ingest pipeline receives its first processing step, `updateExistingStreamsManagedPipeline` was only updating the shared pipeline's processors. It never pushed `update_default_ingest_pipeline` actions for the new stream's current write index, so `index.default_pipeline` was never set on it and documents indexed into that stream bypassed processing entirely. The fix mirrors what `createStreamsManagedPipeline` already does: for every `append_processor_to_ingest_pipeline` action handled by the `updateExistingStreamsManagedPipeline` path, emit a matching `update_default_ingest_pipeline` action so the write index setting is kept in sync. Closes elastic#269984 Co-authored-by: Cursor <cursoragent@cursor.com>
48721eb to
268a865
Compare
… runs
- Switch from PUT /api/streams/{name} to PUT /api/streams/{name}/_ingest
- Fix assertion to use nested object access (source.attributes?.stream_origin)
instead of flat dotted key access, matching how the set processor stores data
- Add after-hook cleanup for the Streams-managed ingest pipelines so that
subsequent local runs start with a clean template pipeline and correctly
exercise the update_default_ingest_pipeline code path
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Pinging @elastic/obs-onboarding-team (Team:obs-onboarding) |
nikita-lavrov
left a comment
There was a problem hiding this comment.
Tested locally and works as expected
💛 Build succeeded, but was flaky
Failed CI Steps
Test Failures
Metrics [docs]
History
|
|
Starting backport for target branches: 9.4 https://github.com/elastic/kibana/actions/runs/26281478381 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…essing to a second OTEL metrics stream (#269988) ## Summary Fixes #269984 When a second classic stream (e.g. a second OTEL metrics data stream) sharing the same template-level ingest pipeline receives its first processing step, `updateExistingStreamsManagedPipeline` was only updating the shared pipeline's processors. It never pushed `update_default_ingest_pipeline` actions for the new stream's current write index, so `index.default_pipeline` was never set on it and documents indexed into that stream bypassed processing entirely. This did not affect logs data streams because their write indices already have `default_pipeline` set by built-in templates. OTEL metrics data streams do not, so they depend entirely on Streams to set the `index.default_pipeline` setting. ## Root cause In `translate_classic_stream_pipeline_actions.ts`, the `updateExistingStreamsManagedPipeline` path (taken when the template pipeline already exists as a streams-managed pipeline) was missing the `update_default_ingest_pipeline` pushes that `createStreamsManagedPipeline` correctly performs for the first stream. ## Fix For every `append_processor_to_ingest_pipeline` action processed by `updateExistingStreamsManagedPipeline`, emit a matching `update_default_ingest_pipeline` action — mirroring what `createStreamsManagedPipeline` already does. ## Testing - Updated the existing unit test (`translate_classic_stream_pipeline_actions.test.ts`) to assert `update_default_ingest_pipeline` is emitted when `updateExistingStreamsManagedPipeline` appends a processor. - Added a new FTR API integration test (`otel_metrics_processing.ts`) that: 1. Creates two `metrics-*.otel-default` data streams via the ES API 2. Adds a `set` processor to the first stream via the Streams API (creates the template pipeline) 3. Adds a `set` processor to the second stream via the Streams API (exercises the previously-broken path) 4. Indexes a document into the second stream and verifies that the processor was actually applied Made with [Cursor](https://cursor.com) --------- Co-authored-by: Cursor <cursoragent@cursor.com>
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Summary
Fixes #269984
When a second classic stream (e.g. a second OTEL metrics data stream) sharing the same template-level ingest pipeline receives its first processing step,
updateExistingStreamsManagedPipelinewas only updating the shared pipeline's processors. It never pushedupdate_default_ingest_pipelineactions for the new stream's current write index, soindex.default_pipelinewas never set on it and documents indexed into that stream bypassed processing entirely.This did not affect logs data streams because their write indices already have
default_pipelineset by built-in templates. OTEL metrics data streams do not, so they depend entirely on Streams to set theindex.default_pipelinesetting.Root cause
In
translate_classic_stream_pipeline_actions.ts, theupdateExistingStreamsManagedPipelinepath (taken when the template pipeline already exists as a streams-managed pipeline) was missing theupdate_default_ingest_pipelinepushes thatcreateStreamsManagedPipelinecorrectly performs for the first stream.Fix
For every
append_processor_to_ingest_pipelineaction processed byupdateExistingStreamsManagedPipeline, emit a matchingupdate_default_ingest_pipelineaction — mirroring whatcreateStreamsManagedPipelinealready does.Testing
translate_classic_stream_pipeline_actions.test.ts) to assertupdate_default_ingest_pipelineis emitted whenupdateExistingStreamsManagedPipelineappends a processor.otel_metrics_processing.ts) that:metrics-*.otel-defaultdata streams via the ES APIsetprocessor to the first stream via the Streams API (creates the template pipeline)setprocessor to the second stream via the Streams API (exercises the previously-broken path)Made with Cursor