-
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] Add agent incoming data endpoint and presentational component #127177
[Fleet] Add agent incoming data endpoint and presentational component #127177
Conversation
Pinging @elastic/fleet (Team:Fleet) |
@elasticmachine merge upstream |
x-pack/plugins/fleet/public/components/agent_enrollment_flyout/confirm_incoming_data.tsx
Outdated
Show resolved
Hide resolved
agentsIds: string[] | ||
) { | ||
try { | ||
const searchResult = await esClient.search({ |
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.
we had previously some performance issue on a similar query with aggregation in the datastream tab does the allow_partial_search_results
and timeout
here prevent this to throw an error?
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.
Good question, I'm not that familiar with this type of query. There are some info in this doc but I'm going to verify with somebody in the es team to get some guidance.
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 changed must
to filter
and added size:0
option based on this conversation: https://elastic.slack.com/archives/C0D8ST60Y/p1646929886103879
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.
Tested locally and the API worked well! 🚀
What do you think of adding an api integration test for the new route? ES query and aggregations are easy to break and it will make the maintenance and future improvements on that API easier
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.
Tested locally and looks good. One very very minor nitpick in the code but otherwise all is well. Thanks for your work on this! 🚀
x-pack/plugins/fleet/public/hooks/use_get_agent_incoming_data.tsx
Outdated
Show resolved
Hide resolved
Thanks @kpollich and @nchaulet for your reviews! I pushed another commit that adds a dynamic button. This is meant to work the same way as the "View assets" button that we currently have in the flyout. |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @criamico |
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.
Ran through again with the new button and all looks great. 🚀
I've been trying to archive the indices for the integration tests with this command but it doesn't work for me: |
I'm merging this and I'll add the integration tests in a subsequent PR. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…elastic#127177) * [Fleet] Create endpoint to check if agent has incoming data * Document new endpoint * Improvements to component * Update endpoint schema * Remove button for now * Address review comments * Add dynamic button functionality * Add option to hide button and improve query Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Part of #125534
Adding an endpoint
agent_status/data
that querieslogs-*-*,metrics-*-*,traces-*-*,synthetics-*-*
to verify that a set of agents is receiving data since the last 5 minutes.Querying the new endpoint from a react component to signal that a newly enrolled agent has received data.
Received data (two possible buttons are shown)

Loading:

Testing steps
To test the component I added it here where agentsIds is an array of strings (the agents ids to check).
<ConfirmIncomingData agentsIds={agentsCheckData} installedPolicy={{ name: 'apm', version: '1.2.0' }} />
<ConfirmIncomingData agentsIds={agentsCheckData} installedPolicy={{ name: 'nginx', version: '1.2.0' }} />
<ConfirmIncomingData agentsIds={agentsCheckData} />
Example of the ES query used:
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers