Skip to content

Conversation

jsoriano
Copy link
Member

@jsoriano jsoriano commented Oct 1, 2025

Summary

Fix https://github.com/elastic/ingest-dev/issues/6173.

Use OTel mappings more strictly in OTel integrations. Main index template is still managed by Fleet, but only otel component templates are used for mappings. Other templates are still used for Fleet-managed settings.
Packages are not expected to define fields with this approach, but they still can.

Fields, and subobjects: false are removed from test package. This needs to be adjusted in a follow up in package spec as packages are required to contain fields now.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

  • Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list
  • This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The release_note:breaking label should be applied in these situations.
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

Identify risks

Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.

@jsoriano jsoriano self-assigned this Oct 1, 2025
Copy link
Contributor

github-actions bot commented Oct 6, 2025

🔍 Preview links for changed docs

@jsoriano jsoriano added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team backport:version Backport to applied version labels v9.2.0 labels Oct 7, 2025
@jsoriano jsoriano marked this pull request as ready for review October 7, 2025 09:58
@jsoriano jsoriano requested a review from a team as a code owner October 7, 2025 09:58
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)


// Override `subobjects: false` to avoid conflicts with traces-otel@mappings
const shouldOverrideSettingsForOtelInputsTraces =
shouldOverrideSettingsForOtelInputs && type === 'traces' && !indexTemplateMappings.runtime;
Copy link
Member Author

Choose a reason for hiding this comment

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

These overrides can be avoided now that non-otel mappings are removed, and packages are not required to define fields.

const agentPolicyName = 'Test input package policy';
const packagePolicyName = 'input-package-policy';
const datasetName = 'check'; // Default from the package.
const datasetName = 'httpcheckreceiver'; // Default from the package.
Copy link
Member Author

Choose a reason for hiding this comment

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

About this change, see #237145 and elastic/elastic-package#2974.

@criamico
Copy link
Contributor

criamico commented Oct 7, 2025

@jsoriano to test this change locally, can I use the httpcheck test package in https://github.com/elastic/elastic-package/tree/main/test/packages/parallel/httpcheck? Is there a new version to use or it remains unchanged?

@jsoriano
Copy link
Member Author

jsoriano commented Oct 7, 2025

@jsoriano to test this change locally, can I use the httpcheck test package in https://github.com/elastic/elastic-package/tree/main/test/packages/parallel/httpcheck? Is there a new version to use or it remains unchanged?

This package needs changes, I am doing them in elastic/elastic-package#2971. You can use the package from that PR, or the zip included in this one (that is a renamed version of the same package).

@criamico
Copy link
Contributor

criamico commented Oct 8, 2025

@jsoriano I built the package from elastic/elastic-package#2971 and tried installing, but I'm seeing again that conflict error when installing the assets:

  1. with metrics dataset:
installAssetsForInputPackagePolicy error: ResponseError: illegal_argument_exception
	Caused by:
		illegal_argument_exception: invalid composite mappings for [metrics-check]
	Root causes:
		illegal_argument_exception: composable template [metrics-check] template after composition with component templates [otel@mappings, otel@settings, metrics-otel@mappings, semconv-resource-to-ecs@mappings, metrics-check@package, metrics@custom, metrics-otel@custom, httpcheck@custom, metrics-check@custom, .fleet_globals-1, .fleet_agent_id_verification-1] is invalid
[2025-10-08T11:01:42.916+02:00][WARN ][plugins.fleet.PackagePolicyClient.create] installAssetsForInputPackagePolicy error: ResponseError: illegal_argument_exception
	Caused by:
		illegal_argument_exception: invalid composite mappings for [metrics-check]
	Root causes:
		illegal_argument_exception: composable template [metrics-check] template after composition with component templates [otel@mappings, otel@settings, metrics-otel@mappings, semconv-resource-to-ecs@mappings, metrics-check@package, metrics@custom, metrics-otel@custom, httpcheck@custom, metrics-check@custom, .fleet_globals-1, .fleet_agent_id_verification-1] is invalid
  1. with logs dataset:
 installAssetsForInputPackagePolicy error: ResponseError: illegal_argument_exception
	Caused by:
		illegal_argument_exception: invalid composite mappings for [logs-check]
	Root causes:
		illegal_argument_exception: composable template [logs-check] template after composition with component templates [otel@mappings, otel@settings, logs-otel@mappings, semconv-resource-to-ecs@mappings, logs-check@package, logs@custom, logs-otel@custom, httpcheck@custom, logs-check@custom, .fleet_globals-1, .fleet_agent_id_verification-1] is invalid
[2025-10-08T11:04:20.849+02:00][WARN ][plugins.fleet.PackagePolicyClient.create] installAssetsForInputPackagePolicy error: ResponseError: illegal_argument_exception
	Caused by:
		illegal_argument_exception: invalid composite mappings for [logs-check]
	Root causes:
		illegal_argument_exception: composable template [logs-check] template after composition with component templates [otel@mappings, otel@settings, logs-otel@mappings, semconv-resource-to-ecs@mappings, logs-check@package, logs@custom, logs-otel@custom, httpcheck@custom, logs-check@custom, .fleet_globals-1, .fleet_agent_id_verification-1] is invalid

in both cases no assets are actually installed at the end.

Maybe something should be updated in the package itself? Otherwise we'll need to keep some of the overrides, this seems the same issue I had in my PR.

@jsoriano
Copy link
Member Author

jsoriano commented Oct 8, 2025

illegal_argument_exception: invalid composite mappings for [metrics-check]

Did you configure check as dataset? It should be using httpcheckreceiver now when using the default values. This is changed in https://github.com/elastic/elastic-package/pull/2971/files#diff-c919485fe09a8e515c05a6cdf0d8cbb60343346504e9477c83d19a9fe1393e1eR29.

A renamed version of this package is being installed by the cypress tests (using the zip in this changeset), and they are passing.

@criamico
Copy link
Contributor

criamico commented Oct 8, 2025

A renamed version of this package is being installed by the cypress tests (using the zip in this changeset), and they are passing.

I tested with this zip file and it worked. The previous version didn't work, even with the updated dataset name, so it must be missing something else.

Copy link
Contributor

@criamico criamico left a comment

Choose a reason for hiding this comment

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

LGTM 🚀 Thanks for the changes!

@jsoriano
Copy link
Member Author

jsoriano commented Oct 9, 2025

@elasticmachine merge upstream

@jsoriano jsoriano enabled auto-merge (squash) October 9, 2025 14:32
@jsoriano
Copy link
Member Author

jsoriano commented Oct 9, 2025

The previous version didn't work, even with the updated dataset name, so it must be missing something else.

Interesting. I think elastic-package may be including leftovers from previous builds, so in this case the package built from source might still contain the removed fields files. I have created an issue about this: elastic/elastic-package#2985

auto-merge was automatically disabled October 9, 2025 15:31

Pull Request is not mergeable

@jsoriano jsoriano enabled auto-merge (squash) October 9, 2025 15:46
@jsoriano jsoriano merged commit 2a79659 into elastic:main Oct 9, 2025
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.2

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @jsoriano

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 9, 2025
…uts (elastic#237165)

Use OTel mappings more strictly in OTel integrations. Main index
template is still managed by Fleet, but only OTel component templates
are used for mappings. Other templates are still used for Fleet-managed
settings.
Packages are not expected to define fields with this approach, but they
still can.

Fields, and `subobjects: false` are removed from test package. This
needs to be adjusted in a follow up in package spec as packages are
required to contain fields now.

(cherry picked from commit 2a79659)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.2

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 9, 2025
…ol inputs (#237165) (#238298)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[Fleet] Install only OTel component template mappings for otelcol
inputs (#237165)](#237165)

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

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

<!--BACKPORT [{"author":{"name":"Jaime Soriano
Pastor","email":"jaime.soriano@elastic.co"},"sourceCommit":{"committedDate":"2025-10-09T16:16:00Z","message":"[Fleet]
Install only OTel component template mappings for otelcol inputs
(#237165)\n\nUse OTel mappings more strictly in OTel integrations. Main
index\ntemplate is still managed by Fleet, but only OTel component
templates\nare used for mappings. Other templates are still used for
Fleet-managed\nsettings.\nPackages are not expected to define fields
with this approach, but they\nstill can.\n\nFields, and `subobjects:
false` are removed from test package. This\nneeds to be adjusted in a
follow up in package spec as packages are\nrequired to contain fields
now.","sha":"2a796596bb89428cf5bde024f70c596eaaf6f417","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","backport:version","v9.2.0","v9.3.0"],"title":"[Fleet]
Install only OTel component template mappings for otelcol
inputs","number":237165,"url":"https://github.com/elastic/kibana/pull/237165","mergeCommit":{"message":"[Fleet]
Install only OTel component template mappings for otelcol inputs
(#237165)\n\nUse OTel mappings more strictly in OTel integrations. Main
index\ntemplate is still managed by Fleet, but only OTel component
templates\nare used for mappings. Other templates are still used for
Fleet-managed\nsettings.\nPackages are not expected to define fields
with this approach, but they\nstill can.\n\nFields, and `subobjects:
false` are removed from test package. This\nneeds to be adjusted in a
follow up in package spec as packages are\nrequired to contain fields
now.","sha":"2a796596bb89428cf5bde024f70c596eaaf6f417"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"9.2","label":"v9.2.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/237165","number":237165,"mergeCommit":{"message":"[Fleet]
Install only OTel component template mappings for otelcol inputs
(#237165)\n\nUse OTel mappings more strictly in OTel integrations. Main
index\ntemplate is still managed by Fleet, but only OTel component
templates\nare used for mappings. Other templates are still used for
Fleet-managed\nsettings.\nPackages are not expected to define fields
with this approach, but they\nstill can.\n\nFields, and `subobjects:
false` are removed from test package. This\nneeds to be adjusted in a
follow up in package spec as packages are\nrequired to contain fields
now.","sha":"2a796596bb89428cf5bde024f70c596eaaf6f417"}}]}] BACKPORT-->

Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
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 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v9.2.0 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants