Skip to content

[Fleet] Add action to Add tags to Agent details page#225433

Merged
juliaElastic merged 4 commits intoelastic:mainfrom
juliaElastic:agent-details-tags
Jun 30, 2025
Merged

[Fleet] Add action to Add tags to Agent details page#225433
juliaElastic merged 4 commits intoelastic:mainfrom
juliaElastic:agent-details-tags

Conversation

@juliaElastic
Copy link
Contributor

@juliaElastic juliaElastic commented Jun 26, 2025

Summary

Closes #222765

Add "Add / remove tags" to Action details page

agent_details_tags.mov

Unenrolled agent

image

Inactive agent

image
@juliaElastic juliaElastic self-assigned this Jun 26, 2025
@juliaElastic juliaElastic requested a review from a team as a code owner June 26, 2025 11:02
@juliaElastic juliaElastic added release_note:enhancement backport:skip This PR does not require backporting labels Jun 26, 2025
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Jun 26, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@MichelLosier MichelLosier left a comment

Choose a reason for hiding this comment

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

Looks great! Just an edge case with inactive agents to look at.

// Fetch all tags when the component mounts
const fetchTags = async () => {
try {
const agentTagsResponse = await sendGetAgentTags({});
Copy link
Contributor

Choose a reason for hiding this comment

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

When I was clicking through this, I incidentally only had inactive agents with tags, and when I went to use this my tag list was blank. If a user is viewing an inactive agent, I think we should include the showInactive option.

Suggested change
const agentTagsResponse = await sendGetAgentTags({});
const agentTagsResponse = await sendGetAgentTags({ showInactive: !agent?.active });

What are your thoughts though of showing tags from inactive agents when viewing active agents? In the same way that we don't by default show inactive agents by default in the agent list, maybe a user is less interested in the tags used by an old fleet of agents, but I could also see it being useful if someone was transitioning to a new fleet of agents and wanting to still use tags from old inactive ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, updated to fetch tags for inactive agents.
Actually agent.active:false stands for unenrolled agents, for those the Add tags action is disabled.
Inactive agents can be identified with agent.status: inactive.

Copy link
Contributor

@MichelLosier MichelLosier left a comment

Choose a reason for hiding this comment

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

Looks good!

@juliaElastic juliaElastic enabled auto-merge (squash) June 27, 2025 15:05
@juliaElastic juliaElastic merged commit eabece9 into elastic:main Jun 30, 2025
10 checks passed
@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 2.1MB 2.1MB +1.1KB

History

cc @juliaElastic

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.2.0

4 participants