Skip to content

[Streams] Show field descriptions in ESQL editor and Discover sidebar#15

Closed
flash1293 wants to merge 1 commit intoralph/issue-35from
ralph/issue-66
Closed

[Streams] Show field descriptions in ESQL editor and Discover sidebar#15
flash1293 wants to merge 1 commit intoralph/issue-35from
ralph/issue-66

Conversation

@flash1293
Copy link
Copy Markdown
Owner

🍒 Summary

⚠️ Depends on elastic#250785 - This PR is stacked on top of the field descriptions PR and should be merged after it.

This PR adds support for showing stream-specific field descriptions in the ESQL editor autocomplete and the Discover field sidebar when querying from a stream (FROM <stream_name>).

This builds on top of elastic#250785 which adds the description property to stream field definitions.

🛠️ Changes

fields_metadata service

  • Added 'streams' as a new FieldSource type
  • Created StreamsFieldsRepository class to cache and fetch stream field metadata
  • Added registerStreamsFieldsExtractor method to allow plugins to register field extractors
  • Updated FieldsMetadataClient to query streams repository when streamName parameter is provided
  • Added streamName parameter to the HTTP API (/internal/fields_metadata)

streams plugin

  • Created register_fields_metadata_extractors.ts to register field extractor at setup
  • Extractor fetches field definitions including descriptions for a given stream name
  • Handles inherited fields from parent streams (wired streams)

ESQL editor

  • Added extractSourceFromQuery() function to parse FROM clause and extract stream name
  • Updated resolveCompletionItem to fetch stream-specific field descriptions
  • Falls back to ECS metadata if no stream-specific description found

Discover sidebar

  • Added streamName prop to FieldDescription, FieldPopoverHeader, and UnifiedFieldListItem
  • Updated UnifiedFieldListSidebarContainer to extract stream name from ES|QL query
  • Stream field descriptions are now displayed when viewing a stream in Discover

Tests

  • Added unit tests for StreamsFieldsRepository
  • Added unit tests for streams fields extractor
  • Added unit tests for extractSourceFromQuery in ESQL editor
  • Added API integration tests for streams fields_metadata integration

🎙️ Prompts

  • "Show streams field descriptions in the ESQL editor autocomplete and field sidebar in Discover when querying from a stream"

🤖 This pull request was assisted by Cursor

Adds support for stream-specific field descriptions to be displayed in the ESQL editor autocomplete and the Discover field sidebar when querying from a stream.

Key changes:
- Extended fields_metadata service with streams as a new field source
- Added registerStreamsFieldsExtractor to allow streams plugin to provide field metadata
- Streams plugin registers extractor that fetches field definitions with descriptions
- Updated ESQL editor to parse FROM clause and fetch stream-specific descriptions
- Updated Discover sidebar to pass stream context for field descriptions
- Added API integration tests for end-to-end flow
@flash1293 flash1293 closed this Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant