Skip to content

Conversation

@flash1293
Copy link
Contributor

@flash1293 flash1293 commented Jun 4, 2025

Adds "detected fields" tab for classic streams enrichment editor

Screenshot 2025-06-04 at 17 58 57

This PR adds the "detected fields" tab for classic streams by fetching the actual Elasticsearch field type from field caps and showing it along with the detected fields. This currently doesn't work for fields that are not mapped yet but would get added as part of the simulation (Elasticsearch feature request here: elastic/elasticsearch#128760 ).

This adds a new column "Elasticsearch field type" to the schema editor table. For wired streams, this column is not relevant at all, but it can be helpful for classic streams to highlight the non-managed parts.

@flash1293 flash1293 added release_note:skip Skip the PR/issue when compiling release notes Team:obs-onboarding Observability Onboarding Team backport:version Backport to applied version labels Feature:Streams This is the label for the Streams Project v9.1.0 v8.19.0 labels Jun 4, 2025
@flash1293 flash1293 linked an issue Jun 4, 2025 that may be closed by this pull request
@flash1293 flash1293 marked this pull request as ready for review June 4, 2025 16:03
@flash1293 flash1293 requested review from a team as code owners June 4, 2025 16:03
@elasticmachine
Copy link
Contributor

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

…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/streams --include-path /api/fleet --include-path /api/dashboards --include-path /api/saved_objects/_import --include-path /api/saved_objects/_export --include-path /api/maintenance_window --update'
return { name, type: confirmedValidDetectedFields[name]?.type };
const existingFieldCaps = Object.keys(streamFieldCaps[name] || {});

const esType = existingFieldCaps.length > 0 ? existingFieldCaps[0] : undefined;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to double check, since we only query the field caps of the write index only one type can be defined per field ?

@klacabane
Copy link
Contributor

Unrelated but should the aliases show as Mapped instead of Inherited for the origin stream ?

inherited_root

const lastIndexMapping = await scopedClusterClient.asCurrentUser.indices.get({
index: lastIndex.index_name,
});
const [lastIndexMapping, lastIndexFieldCaps] = await Promise.all([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this is a wrongly naming I leftover from some previous work, but this is retrieving the last index, not its mappings only. Can you fix the naming around this retrieved value please?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I might be wrong but doesn't the fieldCaps return the same field types as specified in the last index mappings, which is available already on the retrieved index? Or does it return a different result?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field caps have it in normalized form - the same information should be in the mapping as well, but it's very messy (flattened fields, multiple layers of object fields and so on). The structure of field caps is much easier to parse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed

Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's a bit confusing from a user perspective to differentiate between esType and type, for the end user it should be transparent when we talk about a data type, otherwise it might raise questions around what data type a field really has.
For this work, I initially thought the esType (when available) would have been a fallback value for the unmapped fields type, not a parallel value. Can you explain the reasoing behing this choice?

@flash1293
Copy link
Contributor Author

Can you explain the reasoing behing this choice?

The streams-level field type is a normalized thing which we control. The underlying esType can be much more and is not controlled by streams. I made it a separate thing to emphasize the difference (one is something that is controllable by streams, the other thing is a piece of meta data we explicitly don't control). Is your concern about the API/data structure or how it's shown as separate columns in the fields table?

@flash1293
Copy link
Contributor Author

flash1293 commented Jun 5, 2025

Thinking about it, I think it would be OK to make it a fallback of the type column in the table and maybe have a tooltip icon next to it that explains instead of a separate column? Not opposed to that at all. Wdyt?

@tonyghiani
Copy link
Contributor

Thinking about it, I think it would be OK to make it a fallback of the type column in the table and maybe have a tooltip icon next to it that explains instead of a separate column?

Much better IMO, we want to keep the UI as simple as possible for the user, and having multiple column for types might complicate it. A single type column with additional context (tooltip) sound good.

@flash1293
Copy link
Contributor Author

@tonyghiani adjusted like this:

Screenshot 2025-06-05 at 11 45 03

Copy link
Contributor

@tonyghiani tonyghiani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flash1293 flash1293 enabled auto-merge (squash) June 5, 2025 11:01
@flash1293 flash1293 merged commit 36699ad into elastic:main Jun 5, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15466176690

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

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

id before after diff
streamsApp 546.7KB 547.2KB +547.0B

History

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 5, 2025
…22579)

Adds "detected fields" tab for classic streams enrichment editor

<img width="1005" alt="Screenshot 2025-06-04 at 17 58 57"
src="https://github.com/user-attachments/assets/3f3bc959-a27d-4e53-af96-153f0cd0fb54"
/>

This PR adds the "detected fields" tab for classic streams by fetching
the actual Elasticsearch field type from field caps and showing it along
with the detected fields. This currently doesn't work for fields that
are not mapped yet but would get added as part of the simulation
(Elasticsearch feature request here:
elastic/elasticsearch#128760 ).

This adds a new column "Elasticsearch field type" to the schema editor
table. For wired streams, this column is not relevant at all, but it can
be helpful for classic streams to highlight the non-managed parts.

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 36699ad)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

zacharyparikh pushed a commit to zacharyparikh/kibana that referenced this pull request Jun 5, 2025
…22579)

Adds "detected fields" tab for classic streams enrichment editor

<img width="1005" alt="Screenshot 2025-06-04 at 17 58 57"
src="https://github.com/user-attachments/assets/3f3bc959-a27d-4e53-af96-153f0cd0fb54"
/>

This PR adds the "detected fields" tab for classic streams by fetching
the actual Elasticsearch field type from field caps and showing it along
with the detected fields. This currently doesn't work for fields that
are not mapped yet but would get added as part of the simulation
(Elasticsearch feature request here:
elastic/elasticsearch#128760 ).

This adds a new column "Elasticsearch field type" to the schema editor
table. For wired streams, this column is not relevant at all, but it can
be helpful for classic streams to highlight the non-managed parts.

---------

Co-authored-by: kibanamachine <[email protected]>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 9, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @flash1293

1 similar comment
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @flash1293

pmuellr pushed a commit to pmuellr/kibana that referenced this pull request Jun 11, 2025
…22579)

Adds "detected fields" tab for classic streams enrichment editor

<img width="1005" alt="Screenshot 2025-06-04 at 17 58 57"
src="https://github.com/user-attachments/assets/3f3bc959-a27d-4e53-af96-153f0cd0fb54"
/>

This PR adds the "detected fields" tab for classic streams by fetching
the actual Elasticsearch field type from field caps and showing it along
with the detected fields. This currently doesn't work for fields that
are not mapped yet but would get added as part of the simulation
(Elasticsearch feature request here:
elastic/elasticsearch#128760 ).

This adds a new column "Elasticsearch field type" to the schema editor
table. For wired streams, this column is not relevant at all, but it can
be helpful for classic streams to highlight the non-managed parts.

---------

Co-authored-by: kibanamachine <[email protected]>
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @flash1293

1 similar comment
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @flash1293

nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
…22579)

Adds "detected fields" tab for classic streams enrichment editor

<img width="1005" alt="Screenshot 2025-06-04 at 17 58 57"
src="https://github.com/user-attachments/assets/3f3bc959-a27d-4e53-af96-153f0cd0fb54"
/>

This PR adds the "detected fields" tab for classic streams by fetching
the actual Elasticsearch field type from field caps and showing it along
with the detected fields. This currently doesn't work for fields that
are not mapped yet but would get added as part of the simulation
(Elasticsearch feature request here:
elastic/elasticsearch#128760 ).

This adds a new column "Elasticsearch field type" to the schema editor
table. For wired streams, this column is not relevant at all, but it can
be helpful for classic streams to highlight the non-managed parts.

---------

Co-authored-by: kibanamachine <[email protected]>
@kibanamachine
Copy link
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @flash1293

kibanamachine added a commit that referenced this pull request Jun 16, 2025
…22579) (#222798)

# Backport

This will backport the following commits from `main` to `8.19`:
- [🌊 Show detected field types for classic streams enrichment
(#222579)](#222579)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Joe
Reuter","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-05T11:45:32Z","message":"🌊
Show detected field types for classic streams enrichment
(#222579)\n\nAdds \"detected fields\" tab for classic streams enrichment
editor\n\n<img width=\"1005\" alt=\"Screenshot 2025-06-04 at 17 58
57\"\nsrc=\"https://github.com/user-attachments/assets/3f3bc959-a27d-4e53-af96-153f0cd0fb54\"\n/>\n\nThis
PR adds the \"detected fields\" tab for classic streams by fetching\nthe
actual Elasticsearch field type from field caps and showing it
along\nwith the detected fields. This currently doesn't work for fields
that\nare not mapped yet but would get added as part of the
simulation\n(Elasticsearch feature request
here:\nhttps://github.com/elastic/elasticsearch/issues/128760 ).\n\nThis
adds a new column \"Elasticsearch field type\" to the schema
editor\ntable. For wired streams, this column is not relevant at all,
but it can\nbe helpful for classic streams to highlight the non-managed
parts.\n\n---------\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"36699ad4ae5c2f9ba212e05e55c6ee9692a9b2e5","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-ux-logs","backport:version","Feature:Streams","v9.1.0","v8.19.0"],"title":"🌊
Show detected field types for classic streams
enrichment","number":222579,"url":"https://github.com/elastic/kibana/pull/222579","mergeCommit":{"message":"🌊
Show detected field types for classic streams enrichment
(#222579)\n\nAdds \"detected fields\" tab for classic streams enrichment
editor\n\n<img width=\"1005\" alt=\"Screenshot 2025-06-04 at 17 58
57\"\nsrc=\"https://github.com/user-attachments/assets/3f3bc959-a27d-4e53-af96-153f0cd0fb54\"\n/>\n\nThis
PR adds the \"detected fields\" tab for classic streams by fetching\nthe
actual Elasticsearch field type from field caps and showing it
along\nwith the detected fields. This currently doesn't work for fields
that\nare not mapped yet but would get added as part of the
simulation\n(Elasticsearch feature request
here:\nhttps://github.com/elastic/elasticsearch/issues/128760 ).\n\nThis
adds a new column \"Elasticsearch field type\" to the schema
editor\ntable. For wired streams, this column is not relevant at all,
but it can\nbe helpful for classic streams to highlight the non-managed
parts.\n\n---------\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"36699ad4ae5c2f9ba212e05e55c6ee9692a9b2e5"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/222579","number":222579,"mergeCommit":{"message":"🌊
Show detected field types for classic streams enrichment
(#222579)\n\nAdds \"detected fields\" tab for classic streams enrichment
editor\n\n<img width=\"1005\" alt=\"Screenshot 2025-06-04 at 17 58
57\"\nsrc=\"https://github.com/user-attachments/assets/3f3bc959-a27d-4e53-af96-153f0cd0fb54\"\n/>\n\nThis
PR adds the \"detected fields\" tab for classic streams by fetching\nthe
actual Elasticsearch field type from field caps and showing it
along\nwith the detected fields. This currently doesn't work for fields
that\nare not mapped yet but would get added as part of the
simulation\n(Elasticsearch feature request
here:\nhttps://github.com/elastic/elasticsearch/issues/128760 ).\n\nThis
adds a new column \"Elasticsearch field type\" to the schema
editor\ntable. For wired streams, this column is not relevant at all,
but it can\nbe helpful for classic streams to highlight the non-managed
parts.\n\n---------\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"36699ad4ae5c2f9ba212e05e55c6ee9692a9b2e5"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Joe Reuter <[email protected]>
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Streams This is the label for the Streams Project release_note:skip Skip the PR/issue when compiling release notes Team:obs-onboarding Observability Onboarding Team v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Streams 🌊] Show field types for newly extracted fields

5 participants