Skip to content
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

[Fleet] Avoid subobject/scalar mapping conflicts by setting subobjects: false on custom integrations #178397

Merged
merged 5 commits into from
Mar 14, 2024

Conversation

flash1293
Copy link
Contributor

@flash1293 flash1293 commented Mar 11, 2024

In case of a property in indexed documents is sometimes a scalar value (e.g. a number or string) and sometimes an object with sub-properties, mapping conflicts will prevent data from being indexed properly.

The subobjects mapping property makes sure no additional subobject mappings will be defined during runtime. You can learn more here: https://www.elastic.co/guide/en/elasticsearch/reference/current/subobjects.html

This PR sets subobjects: false on logs data streams for custom integrations to avoid. This only affects newly created integrations.

The setting is set via the @package component template.

This only requires a small change in the generated datastream entry, as index_template.mappings are already spread into the index config of the component template:

...omit(indexTemplateMappings, 'properties', 'dynamic_templates', '_source', 'runtime'),

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@flash1293 flash1293 self-assigned this Mar 12, 2024
@flash1293 flash1293 added backport:skip This commit does not require backporting v8.14.0 release_note:feature Makes this part of the condensed release notes Team:Fleet Team label for Observability Data Collection Fleet team labels Mar 12, 2024
@flash1293 flash1293 marked this pull request as ready for review March 12, 2024 16:38
@flash1293 flash1293 requested a review from a team as a code owner March 12, 2024 16:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@flash1293
Copy link
Contributor Author

@felixbarny is it fair to call this a "feature" in the release notes? What would be a good doc page to link to? Simply https://www.elastic.co/guide/en/elasticsearch/reference/current/subobjects.html ?

@felixbarny
Copy link
Member

@felixbarny is it fair to call this a "feature" in the release notes?

Yes, I think so. But I would not frame it as "setting subobjects to false" but talk more about the impact this has i.e. avoiding object/scalar conflicts.

What would be a good doc page to link to? Simply https://www.elastic.co/guide/en/elasticsearch/reference/current/subobjects.html ?

Yes, I think so. Note that on the master branch (https://www.elastic.co/guide/en/elasticsearch/reference/master/subobjects.html), this contains more info about auto flattening. This will be current once 8.14 is released.

Copy link
Contributor

@juliaElastic juliaElastic 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 changed the title Set subobjects: false on custom integrations [Fleet] Avoid subobject/scalar mapping conflicts by setting subobjects: false on custom integrations Mar 13, 2024
@flash1293
Copy link
Contributor Author

Updated the description

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

The CI Stats report is too large to be displayed here, check out the CI build annotation for this information.

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @flash1293

@flash1293 flash1293 merged commit 98aff21 into elastic:main Mar 14, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:feature Makes this part of the condensed release notes Team:Fleet Team label for Observability Data Collection Fleet team v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants