Skip to content

[Fleet] Show reason for agent/endpoint uninstall#205815

Merged
Supplementing merged 38 commits intoelastic:mainfrom
Supplementing:enhancement-show-reason-for-agent-uninstall
Jan 14, 2025
Merged

[Fleet] Show reason for agent/endpoint uninstall#205815
Supplementing merged 38 commits intoelastic:mainfrom
Supplementing:enhancement-show-reason-for-agent-uninstall

Conversation

@Supplementing
Copy link
Contributor

@Supplementing Supplementing commented Jan 7, 2025

Summary

Closes #197731

  • Using the new audit_unenroll_reason, added Orphaned and Uninstalled Badges to the table UI to make those entries distinct from the normal offline entries
  • Added conditional rendering on the labels at the top of the table to only show up when the matches are greater than zero
  • Updated offline counts to be distinct from the orphaned and uninstalled items in those labels
  • Added Orphaned and Uninstalled filters to status filter dropdown

Screenshot of new:
image

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

Identify risks

n/a

Release Note

Improves filtering & visibility of Uninstalled and Orphaned Agents in Fleet, by differentiating them from Offline agents. Status filters have been added for both Uninstalled and Orphaned agents. Agent status runtime field has been updated to return accordingly when an agent is uninstalled or orphaned. Additionally, improved UI by hiding agent labels with 0 agent matches.

@Supplementing Supplementing added release_note:enhancement backport:skip This PR does not require backporting Team:Fleet Team label for Observability Data Collection Fleet team labels Jan 7, 2025
@Supplementing Supplementing marked this pull request as ready for review January 8, 2025 20:45
@Supplementing Supplementing requested a review from a team as a code owner January 8, 2025 20:45
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@Supplementing Supplementing added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:enhancement labels Jan 8, 2025
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update'
@nchaulet
Copy link
Member

nchaulet commented Jan 8, 2025

Could we compute the status in the status runtime field here too? https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/server/services/agents/build_status_runtime_field.ts#L76 it will probably simplify that PR.

kibanamachine and others added 8 commits January 8, 2025 21:17
… rather than needing to do a bunch of work with the audit_unenrolled_reason field
…t --include-path /api/status --include-path /api/alerting/rule/ --include-path /api/alerting/rules --include-path /api/actions --include-path /api/security/role --include-path /api/spaces --include-path /api/fleet --include-path /api/dashboards --update'
@Supplementing Supplementing requested a review from nchaulet January 8, 2025 23:36
@nchaulet
Copy link
Member

nchaulet commented Jan 9, 2025

Took another look overall it looks good, I think adding a new status is probably worth updating our API integration tests for status with those new statuses https://github.com/elastic/kibana/blob/main/x-pack/test/fleet_api_integration/apis/agents/status.ts#L22

There is some doc for those tests https://github.com/elastic/kibana/blob/main/x-pack/platform/plugins/shared/fleet/README.md#api-integration-tests-stateful but feel free to reach out if you need help running them. (the FLEET_SKIP_RUNNING_PACKAGE_REGISTRY=true and running the docker package registry in another tab can help a lot iterating on those tests too)

@Supplementing
Copy link
Contributor Author

@elasticmachine merge upstream

@Supplementing Supplementing enabled auto-merge (squash) January 13, 2025 22:24
@kpollich
Copy link
Member

@elasticmachine merge upstream

))}
{AGENT_STATUSES.map(
(status) =>
agentStatus[status] > 0 && (
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure we want to filter if there is no agent status, we recently changed that #191535

Copy link
Member

Choose a reason for hiding this comment

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

Removed in 3fa3049

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@Supplementing Supplementing merged commit 5803366 into elastic:main Jan 14, 2025
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
fleet 1.7MB 1.7MB +1.0KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
fleet 171.2KB 171.4KB +246.0B

History

viduni94 pushed a commit to viduni94/kibana that referenced this pull request Jan 23, 2025
## Summary

Closes elastic#197731 

- Using the new `audit_unenroll_reason`, added `Orphaned` and
`Uninstalled` Badges to the table UI to make those entries distinct from
the normal `offline` entries
- Added conditional rendering on the labels at the top of the table to
only show up when the matches are greater than zero
- Updated `offline` counts to be distinct from the `orphaned` and
`uninstalled` items in those labels
- Added Orphaned and Uninstalled filters to status filter dropdown

Screenshot of new: 

![image](https://github.com/user-attachments/assets/9126f50d-03e4-4a67-9a20-b5b358478054)


### 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](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
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](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] 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](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) 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](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Identify risks

n/a


## Release Note
Improves filtering & visibility of `Uninstalled` and `Orphaned` Agents
in Fleet, by differentiating them from `Offline` agents. Status filters
have been added for both `Uninstalled` and `Orphaned` agents. Agent
`status` runtime field has been updated to return accordingly when an
agent is `uninstalled` or `orphaned`. Additionally, improved UI by
hiding agent labels with `0` agent matches.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:enhancement Team:Fleet Team label for Observability Data Collection Fleet team v9.0.0

5 participants