-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Ingest Manager] Shared Fleet agent policy action #76013
[Ingest Manager] Shared Fleet agent policy action #76013
Conversation
@@ -21,28 +21,53 @@ export type AgentStatus = | |||
| 'unenrolling' | |||
| 'degraded'; | |||
|
|||
export type AgentActionType = 'CONFIG_CHANGE' | 'DATA_DUMP' | 'RESUME' | 'PAUSE' | 'UNENROLL'; | |||
export type AgentActionType = 'CONFIG_CHANGE' | 'UNENROLL'; |
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.
I did some cleanup as currently we only support this two actions
7bc681e
to
1b7f3ef
Compare
b8a3bed
to
82009b0
Compare
82009b0
to
cd86268
Compare
Pinging @elastic/ingest-management (Team:Ingest Management) |
@elasticmachine merge upstream |
Not sure why I was assigned to this. I blame zube. |
@EricDavisX This one introduce a lot of change and it's probably good candidate for some manual QA :) |
@rahulgupta-qasource - can you pull Nicolas' fork/branch above and run Kibana in source with latest 8.0 / master ES and Agent SNAPSHOT builds and run some tests please? Nicolas and I discussed changes and want to target the tests as such: Set up 2 persistent Windows, and 1 persistent Linux Agent & Endpoint and see them call in to the default config.
Note that viewing the Agent in Fleet and seeing it on-line and config changes is enough validation, it doesn't require a deep validation for now. Then we can do some interesting tests, to try harder to break it:
Let us know how it goes, thank you in advance. |
Hi @EricDavisX Thank you for the update. Could you please share the environment w.r.t above Nicolas fork/branch to validate this ticket. Moreover, Error 'Unable to initialize Ingest Manager: Bad Request' is displayed on clicking 'Ingest Manager' link on 8.0.0-SNAPSHOT Kibana. We have reported bug #77133 for the same. Please let us know if anything is missing from our end. |
I'll discuss testing with Rahul offline and we'll confirm back. |
@@ -15,12 +22,37 @@ export async function createAgentAction( | |||
soClient: SavedObjectsClientContract, | |||
newAgentAction: Omit<AgentAction, 'id'> | |||
): Promise<AgentAction> { | |||
const so = await soClient.create<AgentActionSOAttributes>(AGENT_ACTION_SAVED_OBJECT_TYPE, { | |||
return createAction(soClient, newAgentAction); |
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.
is it possible to overload createAgentAction or have it accept different types instead of having to create the new functions createAgentPolicyAction
and createAction
?
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.
Nice overview in the description and the code is clear. I left some comments and questions but nothing to prevent a 🚀
x-pack/plugins/ingest_manager/server/services/agents/actions.ts
Outdated
Show resolved
Hide resolved
|
💚 Build SucceededBuild metricsSaved Objects .kibana field count
History
To update your PR or re-run it, just comment with: |
…s-for-710 * 'master' of github.com:elastic/kibana: (65 commits) Separate url forwarding logic and legacy services (elastic#76892) Bump yargs-parser to v13.1.2+ (elastic#77009) [Ingest Manager] Shared Fleet agent policy action (elastic#76013) [Search] Re-add support for aborting when a connection is closed (elastic#76470) [Search] Remove long-running query pop-up (elastic#75385) [Monitoring] Fix UI error when alerting is not available (elastic#77179) do not log plugin id format warning in dist mode (elastic#77134) [ML] Improving client side error handling (elastic#76743) [Alerting][Connectors] Refactor IBM Resilient: Generic Implementation (phase one) (elastic#74357) [Docs] some basic searchsource api docs (elastic#77038) add cGroupOverrides to the legacy config (elastic#77180) Change saved object bulkUpdate to work across multiple namespaces (elastic#75478) [Security Solution][Resolver] Replace Selectable popover with badges (elastic#76997) Removing ml-state index from archive (elastic#77143) [Security Solution] Add unit tests for histograms (elastic#77081) [Lens] Filters aggregation (elastic#75635) [Enterprise Search] Update WS Overview logic to use new config data (elastic#77122) Cleanup type output before building new types (elastic#77211) [Security Solution] Use safe type in resolver backend (elastic#76969) Use proper lodash syntax (elastic#77105) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/node_allocation.tsx
we're running the testing now in a separate test ticket, just fyi. |
Summary
Resolve #68956
Currently during a config change (or during the first checkin) we create one saved object for each agent, this PR introduce a new concept of PolicyAction that can be shared between agents.
Done in this PR
AgentPolicyAction
an action that is shared between all agent assigned to a policyack_data
to avoid fetching the whole config in the acknowledge handler.Details
We now have two kind of action:
AgentAction
that target individual agentAgentPolicyAction
that target all the agent assigned to a policy (support only the CONFIG_CHANGE action for now)Also I introduce
ack_data
that are data useful to acknowledge an action, this allow to avoid decrypting the whole config every-time an agent acknowledge an action.This PR introduce a lot of new types, let me know if you have better naming suggestions.
Also I did some cleaning by removing the action type we do not support.
Performance impact
While enrolling 200 agents, than performing a checkin and a ack you can notice the first checkin
checkin_first_time_duration
is a lot fasterBefore
After