Skip to content

Conversation

@tonyghiani
Copy link
Contributor

@tonyghiani tonyghiani commented Sep 22, 2025

📓 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

  • 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

@tonyghiani tonyghiani added release_note:feature Makes this part of the condensed release notes Team:obs-onboarding Observability Onboarding Team Feature:Streams This is the label for the Streams Project labels Sep 22, 2025
@tonyghiani tonyghiani marked this pull request as ready for review September 22, 2025 14:23
@tonyghiani tonyghiani requested review from a team as code owners September 22, 2025 14:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-logs-team (Team:obs-ux-logs)

@tonyghiani tonyghiani added the backport:skip This PR does not require backporting label Sep 22, 2025
Comment on lines 75 to 78
const { fieldsMetadata: rawFieldsMetadata } = useFieldsMetadata({
attributes: ['ignore_above', 'type', 'otel_equivalent'],
source: ['ecs', 'otel'],
});
Copy link
Contributor Author

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.

Copy link
Contributor Author

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}>
Copy link
Contributor Author

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.

@Kerry350 Kerry350 self-requested a review September 23, 2025 09:36
Copy link
Contributor

@Kerry350 Kerry350 left a 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.

  1. Is there any point in showing the fields that are going to be invalid because they already exist? Should we just filter them out?

  2. 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).

Image

@tonyghiani
Copy link
Contributor Author

Is there any point in showing the fields that are going to be invalid because they already exist? Should we just filter them out?

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.

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).

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

Copy link
Contributor

@Kerry350 Kerry350 left a 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 👌

@tonyghiani
Copy link
Contributor Author

@Kerry350 Thanks for the review. I addressed the minor changes and also improved the form behaviours on existing fields.

@Kerry350
Copy link
Contributor

Thanks for the review. I addressed the minor changes and also improved the form behaviours on existing fields.

Thanks, LGTM. Ship it 🚀

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #129 / Space awareness package install "after all" hook in "package install"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
streamsApp 686 698 +12

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fieldsMetadata 47 48 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fieldsMetadata 55.3KB 55.4KB +31.0B
streamsApp 765.7KB 784.2KB +18.5KB
total +18.6KB
Unknown metric groups

API count

id before after diff
fieldsMetadata 47 48 +1

History

@tonyghiani tonyghiani merged commit d4f90ce into elastic:main Sep 23, 2025
12 checks passed
@tonyghiani tonyghiani deleted the 212843-manually-map-new-fields branch September 23, 2025 14:52
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
## 📓 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
niros1 pushed a commit that referenced this pull request Sep 30, 2025
## 📓 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
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
## 📓 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Streams This is the label for the Streams Project release_note:feature Makes this part of the condensed release notes Team:obs-onboarding Observability Onboarding Team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Streams 🌊] Schema Editor - Manually map new fields

4 participants