Skip to content
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] Display outputs in agent list table and agent details #195801

Merged
merged 29 commits into from
Oct 22, 2024

Conversation

criamico
Copy link
Contributor

@criamico criamico commented Oct 10, 2024

Closes #192339

Summary

Display two additional columns with Outputs hosts in agent list table and agent details section

  • The two columns show monitoring output and the integrations output and link to the output flyout in settings
  • Display a badge that show the outputs set per integration introduced by [UII] Support integration-level outputs #189125
  • Same info displayed in agent details as well

To achieve this, I added two new endpoints.

  1. Endpoint that fetches all the outputs associated with a single agent policy (outputs defined on agent policy or default defined in global settings and if any, outputs per integration)
GET kbn:/api/fleet/agent_policies/<AGENT_POLICY_ID>/outputs
  1. Endpoint that fetches the outputs as above, for a defined set of agent policy ids
POST kbn:/api/fleet/agent_policies/outputs
{
  "ids": ["policy_id1", "policy_id2", ...]
}

The reason to pass an array of ids is to ensure that we fetch the info only for the policies displayed in the table at any given moment.

Screenshots

Agent list
Screenshot 2024-10-16 at 17 51 57
Screenshot 2024-10-16 at 17 52 05

Agent details
Screenshot 2024-10-16 at 17 52 20

Checklist

For maintainers

  • This will appear in the Release Notes and follow the guidelines

@criamico criamico self-assigned this Oct 10, 2024
@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico criamico added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 11, 2024
@criamico criamico added the release_note:feature Makes this part of the condensed release notes label Oct 11, 2024
@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico criamico marked this pull request as ready for review October 11, 2024 14:15
@criamico criamico requested a review from a team as a code owner October 11, 2024 14:15
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@criamico criamico added the backport:skip This commit does not require backporting label Oct 11, 2024
@criamico criamico changed the title 192339 show outputs in agents table Commits on Oct 10, 2024 [Fleet] Display outputs in agent list table and agent details Oct 11, 2024
@criamico criamico changed the title Commits on Oct 10, 2024 [Fleet] Display outputs in agent list table and agent details [Fleet] Display outputs in agent list table and agent details Oct 11, 2024
@jen-huang
Copy link
Contributor

/ci

Copy link
Contributor

@jen-huang jen-huang left a comment

Choose a reason for hiding this comment

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

I think this work is not complete yet. With #189125, each integration can set their own output, so I expect the Output for integrations to be the unique sum of all outputs used by the agent policy's integrations, plus the default one set on the agent policy (or global default if unset).

We should be careful about how we retrieve this "deep" association. Perhaps we should either return all outputs used to the agent policy info GET endpoint, or add a separate endpoint specifically to return outputs for a given agent policy ID.

@criamico criamico marked this pull request as draft October 14, 2024 08:18
@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico
Copy link
Contributor Author

criamico commented Oct 14, 2024

With #189125, each integration can set their own output

@jen-huang thanks for pointing it out. I previously missed this piece, so I put back the PR to draft to keep working on it

Perhaps we should either return all outputs used to the agent policy info GET endpoint, or add a separate endpoint specifically to return outputs for a given agent policy ID.

I'm currently working on implementing a new endpoint under agent_policies root:

GET agent_policies/{agentPolicyId}/outputs

My idea is to use this endpoint to retrieve only this information instead of adding it under the existing agent policies get.
I have a very basic draft of this endpoint that can be iterated on:

Screenshot 2024-10-14 at 17 52 05

The response in this case is

{
  "item": {
    "monitoring": {
      "output": {
        "name": "default ES - Multipass",
        "id": "fleet-default-output"
      }
    },
    "data": {
      "output": {
        "name": "default ES - Multipass",
        "id": "fleet-default-output"
      },
      "integrations": [
        {
          "pkgName": "nginx-1",
          "id": "0124705c-1dbb-43fb-8ceb-beb3e867e4c2"
        }
      ]
    }
  }
}

But I'm thinking to return also the name for each output under integrations so I don't need to do another query in the UI down the line.

@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

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

LGTM

@criamico
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #17 / core route timeouts idle socket should timeout if payload sending has too long of an idle period

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
fleet 1213 1214 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
fleet 1296 1301 +5

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 +3.6KB

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.8KB 172.4KB +664.0B
Unknown metric groups

API count

id before after diff
fleet 1421 1426 +5

History

cc @criamico

@criamico criamico added release_note:skip Skip the PR/issue when compiling release notes and removed release_note:feature Makes this part of the condensed release notes labels Oct 22, 2024
@criamico criamico merged commit 3be33bd into elastic:main Oct 22, 2024
27 checks passed
@criamico criamico deleted the 192339_show_outputs_in_agents_table branch October 22, 2024 12:46
@criamico criamico added v8.17.0 backport:version Backport to applied version labels and removed backport:skip This commit does not require backporting labels Oct 22, 2024
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11462875221

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11462875155

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [DOCS][OpenAPI] Change x-technical-preview to x-state in case APIs (#195325)

Manual backport

To create the backport manually run:

node scripts/backport --pr 195801

Questions ?

Please refer to the Backport tool documentation

1 similar comment
@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [DOCS][OpenAPI] Change x-technical-preview to x-state in case APIs (#195325)

Manual backport

To create the backport manually run:

node scripts/backport --pr 195801

Questions ?

Please refer to the Backport tool documentation

@criamico criamico removed the backport:version Backport to applied version labels label Oct 22, 2024
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 23, 2024
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 195801 locally

@criamico criamico added the backport:skip This commit does not require backporting label Oct 23, 2024
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 23, 2024
@criamico criamico added backport missing Added to PRs automatically when the are determined to be missing a backport. and removed v8.17.0 labels Oct 23, 2024
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show outputs in agent list/details UI
5 participants