Skip to content

[8.12] [Fleet] Fix conflicting dynamic template mappings for intermediate objects (#175970)#175991

Merged
kibanamachine merged 1 commit intoelastic:8.12from
kibanamachine:backport/8.12/pr-175970
Jan 31, 2024
Merged

[8.12] [Fleet] Fix conflicting dynamic template mappings for intermediate objects (#175970)#175991
kibanamachine merged 1 commit intoelastic:8.12from
kibanamachine:backport/8.12/pr-175970

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.12:

Questions ?

Please refer to the Backport tool documentation

…jects (elastic#175970)

When there are multiple dynamic templates with the same name, we only
use the first appearance.
Add an exception for intermediate objects, so we use the last
appearance. This way we avoid that less specific dynamic templates
created for intermediate objects match before more specific dynamic
templates defined in packages.

This was a problem for example in the Prometheus package, where there
are definitions for `prometheus.*.value` and `prometheus.*.histogram`.
For both cases Fleet tries to create a dynamic template for the
intermediate objects `prometheus.*`. If this dynamic template is
inserted before the dynamic template for the histograms, it matches for
them, causing mapping errors on ingestion, like the following one:
```
mapper [prometheus.queue_duration.histogram.values] cannot be changed from type [float] to [long]
```
With this change, when multiple definitions generate the same dynamic
template for intermediate objects, only the last one ends up in the
template.

These intermediate objects were introduced in 8.12, after elastic#169981.

(cherry picked from commit 7274f6e)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Jan 31, 2024
@kibanamachine kibanamachine enabled auto-merge (squash) January 31, 2024 14:59
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Jan 31, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

cc @jsoriano

@kibanamachine kibanamachine merged commit 3457f32 into elastic:8.12 Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:Fleet Team label for Observability Data Collection Fleet team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants