[Fleet] Allow to override data stream type in policies for input packages#214216
[Fleet] Allow to override data stream type in policies for input packages#214216jsoriano merged 50 commits intoelastic:mainfrom
Conversation
…put-package-ds-type
|
Almost everything is working here: the UI element works, its state is persisted in the policy, and the index templates are created as expected. But the type is not set in the agent policy, and agents using the policy don't ingest anything. For example in this example |
… package policies
486a493 to
698afc9
Compare
| { | ||
| id: 'traces', | ||
| label: 'Traces', | ||
| }, |
There was a problem hiding this comment.
Is it ok to allow all types for any input package?
In principle I would say so, it is up to the user to know what kind of data they are collecting.
If we think that some packages should be limited to only certain types, we would need to add something in the spec.
| <EuiRadioGroup | ||
| data-test-subj="packagePolicyDataStreamType" | ||
| disabled={isEditPage} | ||
| idSelected={packagePolicyInputStream.data_stream.type || 'logs'} |
There was a problem hiding this comment.
The Package Spec requires a type now in policy templates in input packages.
Should we remove this requirement, now that the type can be configured?
As it is now here, this code will support streams without defined type, and will use logs as default, but older versions of kibana may not work.
There was a problem hiding this comment.
Yes we can probably remove this if we bump the max spec version available in kibana
|
Pinging @elastic/fleet (Team:Fleet) |
| ) | ||
| } | ||
| > | ||
| <EuiRadioGroup |
There was a problem hiding this comment.
It would be probably nice to add some kind of E2E or integration test to check that this radio button works and that the expected index template is created after installing the package and adding a policy.
@juliaElastic @nchaulet wdyt? do you have recommendations about where to start adding such a test?
There was a problem hiding this comment.
We probably could have a cypress test here for that https://github.com/nchaulet/kibana/blob/9ec5275d2f6a8ca0ac3a5a37059d5cb22326fa20/x-pack/platform/plugins/shared/fleet/cypress/e2e/package_policy.cy.ts#L161
…put-package-ds-type
…put-package-ds-type
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
cc @jsoriano |
…ages (elastic#214216) Allow to select the data stream type when creating policies for input packages. It is only possible to select the data stream type when creating policies and not when editing them. The selector is added as an advanced option.
|
Starting backport for target branches: 8.17, 8.18, 8.19 https://github.com/elastic/kibana/actions/runs/15543134795 |
…ages (elastic#214216) Allow to select the data stream type when creating policies for input packages. It is only possible to select the data stream type when creating policies and not when editing them. The selector is added as an advanced option. (cherry picked from commit 4337d10)
…ages (elastic#214216) Allow to select the data stream type when creating policies for input packages. It is only possible to select the data stream type when creating policies and not when editing them. The selector is added as an advanced option. (cherry picked from commit 4337d10)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…ut packages (#214216) (#223151) # Backport This will backport the following commits from `main` to `8.18`: - [[Fleet] Allow to override data stream type in policies for input packages (#214216)](#214216) <!--- 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-05-26T16:44:19Z","message":"[Fleet] Allow to override data stream type in policies for input packages (#214216)\n\nAllow to select the data stream type when creating policies for input\npackages.\nIt is only possible to select the data stream type when creating policies\nand not when editing them.\nThe selector is added as an advanced option.","sha":"4337d10c215f0e87b2da746026f455e62ab60e22","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Fleet","release_note:feature","backport:prev-major","v9.1.0"],"title":"[Fleet] Allow to override data stream type in policies for input packages","number":214216,"url":"https://github.com/elastic/kibana/pull/214216","mergeCommit":{"message":"[Fleet] Allow to override data stream type in policies for input packages (#214216)\n\nAllow to select the data stream type when creating policies for input\npackages.\nIt is only possible to select the data stream type when creating policies\nand not when editing them.\nThe selector is added as an advanced option.","sha":"4337d10c215f0e87b2da746026f455e62ab60e22"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214216","number":214216,"mergeCommit":{"message":"[Fleet] Allow to override data stream type in policies for input packages (#214216)\n\nAllow to select the data stream type when creating policies for input\npackages.\nIt is only possible to select the data stream type when creating policies\nand not when editing them.\nThe selector is added as an advanced option.","sha":"4337d10c215f0e87b2da746026f455e62ab60e22"}}]}] BACKPORT--> Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
…ut packages (#214216) (#223152) # Backport This will backport the following commits from `main` to `8.19`: - [[Fleet] Allow to override data stream type in policies for input packages (#214216)](#214216) <!--- 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-05-26T16:44:19Z","message":"[Fleet] Allow to override data stream type in policies for input packages (#214216)\n\nAllow to select the data stream type when creating policies for input\npackages.\nIt is only possible to select the data stream type when creating policies\nand not when editing them.\nThe selector is added as an advanced option.","sha":"4337d10c215f0e87b2da746026f455e62ab60e22","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Fleet","release_note:feature","backport:prev-major","v9.1.0"],"title":"[Fleet] Allow to override data stream type in policies for input packages","number":214216,"url":"https://github.com/elastic/kibana/pull/214216","mergeCommit":{"message":"[Fleet] Allow to override data stream type in policies for input packages (#214216)\n\nAllow to select the data stream type when creating policies for input\npackages.\nIt is only possible to select the data stream type when creating policies\nand not when editing them.\nThe selector is added as an advanced option.","sha":"4337d10c215f0e87b2da746026f455e62ab60e22"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214216","number":214216,"mergeCommit":{"message":"[Fleet] Allow to override data stream type in policies for input packages (#214216)\n\nAllow to select the data stream type when creating policies for input\npackages.\nIt is only possible to select the data stream type when creating policies\nand not when editing them.\nThe selector is added as an advanced option.","sha":"4337d10c215f0e87b2da746026f455e62ab60e22"}}]}] BACKPORT--> Co-authored-by: Jaime Soriano Pastor <jaime.soriano@elastic.co>
Summary
Part of elastic/package-spec#849.
Allow to select the data stream type when creating policies for input packages. This will allow to benefit from presets related to specific signal types.
It adds the following selector as an advanced option:
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker listThis was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. Therelease_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesHow to test
type: inputin their manifests, such as sql or log packages).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.