Skip to content

docs: add guidance on object and flattened field types#2594

Merged
andrewkroh merged 4 commits intoelastic:mainfrom
andrewkroh:add-object-field-guidance
Apr 14, 2026
Merged

docs: add guidance on object and flattened field types#2594
andrewkroh merged 4 commits intoelastic:mainfrom
andrewkroh:add-object-field-guidance

Conversation

@andrewkroh
Copy link
Copy Markdown
Member

Summary

Add documentation clarifying when object and flattened field types are
acceptable in ECS, and when explicit leaf fields must be used instead.

Motivation

The entity field set introduced 5 open object containers
(entity.attributes, entity.behavior, entity.lifecycle,
entity.metrics, entity.raw) with zero defined children. This allows
integrations to independently define subfields with conflicting types and
semantics, bypassing the coordination that ECS exists to provide.

The pattern is being replicated (see #2577), and the concern was raised
during review but there is no documented policy to point to.

What this establishes

An object with no defined children should only be used for opaque,
source-specific data with a homogeneous shape (like labels). A flattened
field should be used when arbitrary keys would cause mapping explosion (like
HTTP headers). Neither is appropriate when the subfields carry semantic
meaning. In those cases, explicit leaf fields with specified types must be
defined in the schema.

The RFC template now prompts contributors to justify any use of object or
flattened without defined children.

Add documentation to schemas/README.md explaining when object and
flattened field types are acceptable in ECS schema definitions,
and when explicit leaf fields must be used instead.

Add a review checkpoint to the RFC template requiring
contributors to justify any use of object or flattened types
without defined children.
@andrewkroh andrewkroh requested a review from a team March 27, 2026 15:46
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Comment thread rfcs/0000-rfc-template.md
Comment thread schemas/README.md Outdated
Comment thread schemas/README.md Outdated
Comment thread schemas/README.md Outdated
@trisch-me
Copy link
Copy Markdown
Contributor

closes #2595
@andrewkroh do you want to have more restrictions i.e. via CI or this guidance is sufficient?

@trisch-me trisch-me linked an issue Apr 7, 2026 that may be closed by this pull request
…ance

- Add entity.raw as an example of acceptable flattened field use
- Replace entity-specific examples (mfa_enabled, managed,
  granted_permissions) with a generic description of when explicit leaf
  fields are required
@andrewkroh
Copy link
Copy Markdown
Member Author

andrewkroh commented Apr 13, 2026

do you want to have more restrictions i.e. via CI or this guidance is sufficient?

Let's start with this guidance only.

@andrewkroh andrewkroh merged commit cfd56c9 into elastic:main Apr 14, 2026
8 checks passed
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.

Restrict use of open object typed fields in ECS schema

3 participants