-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Make input IDs unique in agent policy yaml #127343
Conversation
Pinging @elastic/fleet (Team:Fleet) |
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: cc @jen-huang |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
@ph @jen-huang before backporting and releasing this, we need to resolve this downstream effect: #127570 More details on what we're seeing on our side in this this comment: #127570 (comment) Essentially, the Endpoint is now adding the |
@kevinlog, currently we do not persist that id, but if we persist that id on the package policy saved object, you will be able to query the package policy saved object with the id to retrieve the package policy id, it is something that will work for you? We can expose a service |
@kevinlog Thanks for pointing this out, sorry for not having communicated that clearly with everyone. For the Agent, we will merge the changes because they currently affect Filebeat. We haven't changed the logic on the endpoint configuration. We are still giving the complete input block. @nchaulet @jen-huang I haven't considered that, but would the following be true: When a user upgrades they will still be using the old ids for input that aren't unique? |
Yes until they do something that trigger a policy change, (changing anything in the policy or a global change to outputs or settings) |
I'm not sure yet of the full impact of the changes to the I would also like to request that the actual Package Policy ID be included in the YAML if the - id: endpoint-066fdf94-a6bc-4185-b27d-0245f96e3ab9
name: Security
revision: 4
type: endpoint
use_output: default
meta:
package:
name: endpoint
version: 1.5.0 We can then maybe see if we can get Endpoint to return that back to us in their messages and we can start to use it again. |
Question: Could this |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
* Make package policy input IDs unique * Lint * Fix tests * Add unit test * Lint (cherry picked from commit 0e99e94) # Conflicts: # x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap
* Make package policy input IDs unique * Lint * Fix tests * Add unit test * Lint (cherry picked from commit 0e99e94) # Conflicts: # x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap
* Make package policy input IDs unique * Lint * Fix tests * Add unit test * Lint (cherry picked from commit 0e99e94) # Conflicts: # x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap
* Make package policy input IDs unique * Lint * Fix tests * Add unit test * Lint (cherry picked from commit 0e99e94) # Conflicts: # x-pack/plugins/fleet/server/integration_tests/__snapshots__/cloud_preconfiguration.test.ts.snap Co-authored-by: Kibana Machine <[email protected]>
The input IDs changing from a non-unique to a unique one? That will duplicate the events once. If a filestream input that did not have an ID set gets an ID, we can migrate the data in the registry and not duplicate events. My PR #30717 focus on adding IDs to filestream inputs that did not have one. Other cases have not been covered there. |
Hi @joshdover
Build details:
Hence marking this as QA:Validated. |
Summary
Resolves #125844. This PR makes input IDs in the final generated agent policy unique by building it from the parent package policy ID + input type + the associated policy template name (if any).
When a package policy is built, its streams are grouped by input type+policy template, so that combination should be unique (and stable) on each package policy.
This screenshot shows an example of unique IDs being generated for AWS billing and Cloudtrail inputs:
Checklist