-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Streams] Manually map new fields from schema editor #235919
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
[Streams] Manually map new fields from schema editor #235919
Conversation
|
Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs) |
| const { fieldsMetadata: rawFieldsMetadata } = useFieldsMetadata({ | ||
| attributes: ['ignore_above', 'type', 'otel_equivalent'], | ||
| source: ['ecs', 'otel'], | ||
| }); |
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.
Get all ecs/otel fields, selecting only required properties to reduce payload size and populate the suggestions selector.
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.
Minor design refactor to align with the ComboBox usage in the form and avoid multiple clicks between suggestions and custom options.
|
|
||
| return ( | ||
| <> | ||
| <EuiFlyout ownFocus onClose={onClose} aria-labelledby={flyoutId} maxWidth={500}> |
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.
Fixes focus issue detected on selectors.
…i/kibana into 212843-manually-map-new-fields
Kerry350
left a comment
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.
Couple of functionality questions, I'll look at the code next.
-
Is there any point in showing the fields that are going to be invalid because they already exist? Should we just filter them out?
-
When in an invalid state the "Add field" button doesn't do anything (which is correct), but it isn't explicitly disabled (so doesn't look disabled).
We could filter out the existing ones from the suggestions yeah, but users would still be able to manually write a colliding field name, so we should probably keep this around.
It does trigger the validation every time it is clicked, but if the user updates the field affected by error, the error itself will disappear, and they'd still be able to click the add button. I'll look for an easy way to disable it when it's invalid and re-enable as soon as the field is touched/changed |
Kerry350
left a comment
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.
Just a few functional questions / nits, but everything works as expected, nice work 👌
...orm/plugins/shared/fields_metadata/server/services/fields_metadata/fields_metadata_client.ts
Outdated
Show resolved
Hide resolved
...ared/streams_app/public/components/data_management/schema_editor/flyout/add_field_flyout.tsx
Outdated
Show resolved
Hide resolved
|
@Kerry350 Thanks for the review. I addressed the minor changes and also improved the form behaviours on existing fields. |
Thanks, LGTM. Ship it 🚀 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
|
## 📓 Summary Closes elastic#212843 This work adds a new user journey to allow Streams users to create new field mappings manually from the Schema editor. https://github.com/user-attachments/assets/5a5ffb15-5085-48ab-84e2-4dcec87f7577 Bonus point, the work introduces a change to the fields_metadata service to filter the retrieved fields by their source (ecs, otel, etc) to allow getting only the required lists. ## 🧪 Testing - Start Kibana with admin privileges - If **Streams** is disabled, enable the feature by toggling the Kibana Advanced Setting `Streams` - Ingest some logs data with `node scripts/synthtrace.js sample_logs` - Navigate to `/app/streams` and select one of the available streams (except the `logs` root stream, pick any other) - Click the **Add field** button on the top-right corner
## 📓 Summary Closes #212843 This work adds a new user journey to allow Streams users to create new field mappings manually from the Schema editor. https://github.com/user-attachments/assets/5a5ffb15-5085-48ab-84e2-4dcec87f7577 Bonus point, the work introduces a change to the fields_metadata service to filter the retrieved fields by their source (ecs, otel, etc) to allow getting only the required lists. ## 🧪 Testing - Start Kibana with admin privileges - If **Streams** is disabled, enable the feature by toggling the Kibana Advanced Setting `Streams` - Ingest some logs data with `node scripts/synthtrace.js sample_logs` - Navigate to `/app/streams` and select one of the available streams (except the `logs` root stream, pick any other) - Click the **Add field** button on the top-right corner
## 📓 Summary Closes elastic#212843 This work adds a new user journey to allow Streams users to create new field mappings manually from the Schema editor. https://github.com/user-attachments/assets/5a5ffb15-5085-48ab-84e2-4dcec87f7577 Bonus point, the work introduces a change to the fields_metadata service to filter the retrieved fields by their source (ecs, otel, etc) to allow getting only the required lists. ## 🧪 Testing - Start Kibana with admin privileges - If **Streams** is disabled, enable the feature by toggling the Kibana Advanced Setting `Streams` - Ingest some logs data with `node scripts/synthtrace.js sample_logs` - Navigate to `/app/streams` and select one of the available streams (except the `logs` root stream, pick any other) - Click the **Add field** button on the top-right corner
📓 Summary
Closes #212843
This work adds a new user journey to allow Streams users to create new field mappings manually from the Schema editor.
Screen.Recording.2025-09-22.at.16.20.04.mov
Bonus point, the work introduces a change to the fields_metadata service to filter the retrieved fields by their source (ecs, otel, etc) to allow getting only the required lists.
🧪 Testing
Streamsnode scripts/synthtrace.js sample_logs/app/streamsand select one of the available streams (except thelogsroot stream, pick any other)