Commit e8ef633
🌊 Streams: Classic streams field mappings (#228415)
This PR adds the ability to map fields in classic streams. This fits
really well into the existing flow - it's basically just enabling the
schema editor for classic streams. Under the hood this is using the new
data stream mappings API instead of changing component templates.
Changes that are compatible with the write index mapping are applied
directly, otherwise a rollover is performed automatically.
Schema editor for a classic stream. Fields mapped via streams are marked
as "mapped". Fields that are mapped via the underlying index template
are shown as "unmanaged", with a type that comes from field caps (the
tooltip is calling it out).
<img width="1248" height="647" alt="Screenshot 2025-07-17 at 17 23 40"
src="https://github.com/user-attachments/assets/c8e20652-6394-43e2-b119-b42aa78418a6"
/>
<img width="743" height="223" alt="Screenshot 2025-07-17 at 17 26 53"
src="https://github.com/user-attachments/assets/e2fcb6f7-6e5d-46da-b2e5-1698b31b4a1d"
/>
Previously it was called "unmapped" - it's unmapped on the streams
level, but not actually unmapped in the underlying data. I'm sure that
will be confusing. I'm not sure whether "unmanaged" is good enough,
happy to hear other opinions.
In the processing view, the fields are shown in the same way
<img width="1247" height="411" alt="Screenshot 2025-07-17 at 17 28 05"
src="https://github.com/user-attachments/assets/cc251181-4bfd-44a4-952d-6ce2326f0159"
/>
It's possible that a mapping isn't compatible with what's defined in the
template of a stream. In this case an toast error is shown when the user
is trying to save (hopefully it explains well enough what's going on,
it's basically what comes from Elasticsearch):
<img width="399" height="314" alt="Screenshot 2025-07-17 at 17 46 58"
src="https://github.com/user-attachments/assets/a7ec64c2-40dd-4045-b499-7d77a11c4a0a"
/>
## Notes
### Discover
I think the types were incomplete here - the boolean flag in question is
definitely returned in these objects, that's why adjusted upstream.
### Simulation reset too early
A little drive-by fix: If the saving of the processing changes failed,
the simulation would have been reset already, which makes us loose the
field mappings that are staged there. This PR moves the reset to the
success state transition, so everything sticks around on failure so the
user can fix and try again.
### Rollover logic
If the mapping is changed, the data stream is rolled over.
### Error handling
If setting the mapping on the data stream level doesn't work, we bail
out. This should trigger a resync with
#227738 , which will bring the
system into a valid state again. However, this is considered a 500
instead of a 400. By using the dry run in the validation phase we can
catch it early, but not sure whether it's worth it... (it also takes
longer of course).
### Sourcing fields
Fetching the fields for the schema editor, it's now also sourcing them
from the field caps along with the definition and unmapped fields API,
to give as complete of a picture as possible.
### Field simulation
Had to adjust the field simulation logic a bit, I think I actually
simplified it successfully so it works the same for wired and classic
streams, but worth taking another look.
---------
Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Kerry Gallagher <[email protected]>
Co-authored-by: Kerry Gallagher <[email protected]>1 parent dcdc9d7 commit e8ef633
File tree
30 files changed
+1465
-292
lines changed- oas_docs
- output
- x-pack/platform
- test/api_integration_deployment_agnostic/apis/streams
30 files changed
+1465
-292
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55583 | 55583 | | |
55584 | 55584 | | |
55585 | 55585 | | |
55586 | | - | |
| 55586 | + | |
| 55587 | + | |
| 55588 | + | |
| 55589 | + | |
| 55590 | + | |
| 55591 | + | |
| 55592 | + | |
| 55593 | + | |
| 55594 | + | |
| 55595 | + | |
| 55596 | + | |
| 55597 | + | |
| 55598 | + | |
| 55599 | + | |
| 55600 | + | |
| 55601 | + | |
| 55602 | + | |
| 55603 | + | |
| 55604 | + | |
| 55605 | + | |
| 55606 | + | |
| 55607 | + | |
| 55608 | + | |
| 55609 | + | |
| 55610 | + | |
| 55611 | + | |
| 55612 | + | |
| 55613 | + | |
| 55614 | + | |
| 55615 | + | |
| 55616 | + | |
| 55617 | + | |
| 55618 | + | |
| 55619 | + | |
| 55620 | + | |
| 55621 | + | |
| 55622 | + | |
| 55623 | + | |
| 55624 | + | |
| 55625 | + | |
| 55626 | + | |
| 55627 | + | |
| 55628 | + | |
| 55629 | + | |
| 55630 | + | |
| 55631 | + | |
| 55632 | + | |
| 55633 | + | |
| 55634 | + | |
| 55635 | + | |
| 55636 | + | |
| 55637 | + | |
| 55638 | + | |
| 55639 | + | |
| 55640 | + | |
| 55641 | + | |
| 55642 | + | |
| 55643 | + | |
| 55644 | + | |
| 55645 | + | |
| 55646 | + | |
| 55647 | + | |
| 55648 | + | |
| 55649 | + | |
| 55650 | + | |
| 55651 | + | |
| 55652 | + | |
| 55653 | + | |
| 55654 | + | |
| 55655 | + | |
| 55656 | + | |
| 55657 | + | |
| 55658 | + | |
| 55659 | + | |
| 55660 | + | |
| 55661 | + | |
| 55662 | + | |
| 55663 | + | |
| 55664 | + | |
| 55665 | + | |
| 55666 | + | |
| 55667 | + | |
| 55668 | + | |
| 55669 | + | |
| 55670 | + | |
| 55671 | + | |
| 55672 | + | |
| 55673 | + | |
| 55674 | + | |
| 55675 | + | |
| 55676 | + | |
| 55677 | + | |
| 55678 | + | |
| 55679 | + | |
| 55680 | + | |
| 55681 | + | |
| 55682 | + | |
| 55683 | + | |
| 55684 | + | |
| 55685 | + | |
| 55686 | + | |
| 55687 | + | |
| 55688 | + | |
| 55689 | + | |
| 55690 | + | |
| 55691 | + | |
| 55692 | + | |
| 55693 | + | |
55587 | 55694 | | |
55588 | 55695 | | |
55589 | 55696 | | |
| |||
65017 | 65124 | | |
65018 | 65125 | | |
65019 | 65126 | | |
65020 | | - | |
| 65127 | + | |
| 65128 | + | |
| 65129 | + | |
| 65130 | + | |
| 65131 | + | |
| 65132 | + | |
| 65133 | + | |
| 65134 | + | |
| 65135 | + | |
| 65136 | + | |
| 65137 | + | |
| 65138 | + | |
| 65139 | + | |
| 65140 | + | |
| 65141 | + | |
| 65142 | + | |
| 65143 | + | |
| 65144 | + | |
| 65145 | + | |
| 65146 | + | |
| 65147 | + | |
| 65148 | + | |
| 65149 | + | |
| 65150 | + | |
| 65151 | + | |
| 65152 | + | |
| 65153 | + | |
| 65154 | + | |
| 65155 | + | |
| 65156 | + | |
| 65157 | + | |
| 65158 | + | |
| 65159 | + | |
| 65160 | + | |
| 65161 | + | |
| 65162 | + | |
| 65163 | + | |
| 65164 | + | |
| 65165 | + | |
| 65166 | + | |
| 65167 | + | |
| 65168 | + | |
| 65169 | + | |
| 65170 | + | |
| 65171 | + | |
| 65172 | + | |
| 65173 | + | |
| 65174 | + | |
| 65175 | + | |
| 65176 | + | |
| 65177 | + | |
| 65178 | + | |
| 65179 | + | |
| 65180 | + | |
| 65181 | + | |
| 65182 | + | |
| 65183 | + | |
| 65184 | + | |
| 65185 | + | |
| 65186 | + | |
| 65187 | + | |
| 65188 | + | |
| 65189 | + | |
| 65190 | + | |
| 65191 | + | |
| 65192 | + | |
| 65193 | + | |
| 65194 | + | |
| 65195 | + | |
| 65196 | + | |
| 65197 | + | |
| 65198 | + | |
| 65199 | + | |
| 65200 | + | |
| 65201 | + | |
| 65202 | + | |
| 65203 | + | |
| 65204 | + | |
| 65205 | + | |
| 65206 | + | |
| 65207 | + | |
| 65208 | + | |
| 65209 | + | |
| 65210 | + | |
| 65211 | + | |
| 65212 | + | |
| 65213 | + | |
| 65214 | + | |
| 65215 | + | |
| 65216 | + | |
| 65217 | + | |
| 65218 | + | |
| 65219 | + | |
| 65220 | + | |
| 65221 | + | |
| 65222 | + | |
| 65223 | + | |
| 65224 | + | |
| 65225 | + | |
| 65226 | + | |
| 65227 | + | |
| 65228 | + | |
| 65229 | + | |
| 65230 | + | |
| 65231 | + | |
| 65232 | + | |
| 65233 | + | |
| 65234 | + | |
65021 | 65235 | | |
65022 | 65236 | | |
65023 | 65237 | | |
| |||
0 commit comments