[Fleet] Add collector onboarding steps to UI#254491
[Fleet] Add collector onboarding steps to UI#254491juliaElastic merged 17 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/fleet (Team:Fleet) |
|
|
||
| // Hide agentless policies by default unless showAgentless toggle is enabled | ||
| const getSearchWithDefaults = (newSearch: string) => { | ||
| const kueryHideOpAMP = `NOT ${agentPolicySavedObjectType}.name:"${OPAMP_POLICY_NAME}"`; |
There was a problem hiding this comment.
The agents won't be hidden, only the agent policy "OpAMP" because it's not intended to be used for anything else. We could probably show it as a managed policy (so users can't enroll Elastic Agents to it).
| <EuiToolTip content="Monitor an OTel collector in Fleet with OpAMP."> | ||
| <EuiButton | ||
| fill | ||
| color="accent" |
There was a problem hiding this comment.
Why the accent color from Eui guideline:
Pulls attention to key indicators like notifications or number of selections
There was a problem hiding this comment.
Wanted to use a different color than Add agent, but this is going to change according to https://github.com/elastic/ingest-dev/issues/7019#issuecomment-3948730370
| let opampPolicy = await fetchOpampPolicy(); | ||
| if (!opampPolicy) { | ||
| // 2. Create if not exists | ||
| const created = await createOpampPolicyWithHook(); |
There was a problem hiding this comment.
Not totally related to that PR, I have some questions on that:
- did we considered creating that policy as part of the setup? I am curious how this will looks like for some that do not use Fleet UI but some IAC tools to add opamp agents.
- How that policy will work in non default space should we either have one policy per space, with maybe the space in the id, or should we share that policy accross all spaces and agents at the same time
There was a problem hiding this comment.
For IAC tools, they would have to use the API to create/get an enrollment token. We can make it easier for them to create the OpAMP agent policy in setup, so the enrollment token is available with one API call. Alternatively we could document creating a preconfigured OpAMP agent policy for them.
For space support, I think it's a valid use case to group collectors to different spaces, so probably best to create a policy per space, similarly to fleet-server-policy.
There was a problem hiding this comment.
For space support, I think it's a valid use case to group collectors to different spaces, so probably best to create a policy per space, similarly to fleet-server-policy.
Should we do this that PR or do we want a followup PR for that? I can create the issue if you want
There was a problem hiding this comment.
I can take a look in this PR
| pollImmediately: true, | ||
| }); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
depending on the discussion bellow could be a good candidate for useQuery instead
|
@juliaElastic I made some comments in https://github.com/elastic/ingest-dev/issues/7019 to slightly re-design this page. |
|
|
||
| const isLogAndMetricsEnabled = agentPolicy?.monitoring_enabled?.length ?? 0 > 0; | ||
| const isLogAndMetricsEnabled = | ||
| (agentPolicy?.monitoring_enabled?.length ?? 0) > 0 || agent.type === 'OPAMP'; |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
|
mdbirnstiehl
left a comment
There was a problem hiding this comment.
One suggestion, but lgtm!
...ublic/applications/fleet/sections/agents/agent_list_page/components/add_collector_flyout.tsx
Outdated
Show resolved
Hide resolved
…/sections/agents/agent_list_page/components/add_collector_flyout.tsx Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com>
## Summary Closes elastic/ingest-dev#7019 To test: - enable feature flag `xpack.fleet.enableExperimental: ['enableOpAMP']` - Add collector button should be visible on the Fleet UI - When clicking on it, a flyout opens with steps to add collector - The flyout creates an agent policy (`id:opamp`) and displays opamp config with enrollment api key and fleet server host - The flyout confirms if collectors are connected - The OpAMP policy is hidden from Agent policy list UI Update: moved the collector button in a context menu with the other add buttons: https://github.com/user-attachments/assets/069e4d2b-978e-4041-bf0b-b29ef6ad3582 <img width="1107" height="569" alt="image" src="https://github.com/user-attachments/assets/e48f146e-2ed3-4346-8f54-4725b0260cfb" /> <img width="1114" height="868" alt="image" src="https://github.com/user-attachments/assets/9fdb04fb-99e2-4a26-a544-6f5779f36a79" /> <img width="585" height="834" alt="image" src="https://github.com/user-attachments/assets/e68ae8f5-26ed-4265-a098-71e4dc2768cd" /> <img width="590" height="838" alt="image" src="https://github.com/user-attachments/assets/e46c4ac3-6204-4a71-b3b6-cb4e4875dc2f" /> <img width="1113" height="614" alt="image" src="https://github.com/user-attachments/assets/93a759b3-6416-4855-9e63-e03abfe12be9" /> ### 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) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Mike Birnstiehl <114418652+mdbirnstiehl@users.noreply.github.com>
## Summary Closes elastic/ingest-dev#7148 Relates #254491 Relates elastic/ingest-dev#6982 Relates #252541 Enable OpAMP feature flag The feature flag enables the `Add collector` button in Fleet UI and the `/effective_config` route that is used from the Agent Details UI if the agent is an OTel collector. <img width="2214" height="1824" alt="image" src="https://github.com/user-attachments/assets/1520a587-8844-43d4-8d92-e93ca09527fe" /> Serverless: <img width="1308" height="723" alt="image" src="https://github.com/user-attachments/assets/79b9b086-b693-4c45-8bdc-c586bbd71dee" /> ## Release note Enables OpenTelemetry (OTel) collector support in Fleet. Users can now add OTel collector agents via a new Add collector button in the Fleet UI. OTel collectors will be visible in Fleet Agent list, with the ability to monitor them (view their Component Health, Effective Config, link to internal telemetry dashboard). The feature is in technical preview. ### 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) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary Closes elastic/ingest-dev#7148 Relates elastic#254491 Relates elastic/ingest-dev#6982 Relates elastic#252541 Enable OpAMP feature flag The feature flag enables the `Add collector` button in Fleet UI and the `/effective_config` route that is used from the Agent Details UI if the agent is an OTel collector. <img width="2214" height="1824" alt="image" src="https://github.com/user-attachments/assets/1520a587-8844-43d4-8d92-e93ca09527fe" /> Serverless: <img width="1308" height="723" alt="image" src="https://github.com/user-attachments/assets/79b9b086-b693-4c45-8bdc-c586bbd71dee" /> ## Release note Enables OpenTelemetry (OTel) collector support in Fleet. Users can now add OTel collector agents via a new Add collector button in the Fleet UI. OTel collectors will be visible in Fleet Agent list, with the ability to monitor them (view their Component Health, Effective Config, link to internal telemetry dashboard). The feature is in technical preview. ### 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) - [ ] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss. Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging. - [ ] [See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) - [ ] ... --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>


Summary
Closes https://github.com/elastic/ingest-dev/issues/7019
To test:
xpack.fleet.enableExperimental: ['enableOpAMP']id:opamp) and displays opamp config with enrollment api key and fleet server hostUpdate: moved the collector button in a context menu with the other add buttons:
add_collector_menu.mov
Checklist
Check the PR satisfies following conditions.
Reviewers should verify this PR satisfies this list as well.
release_note:breakinglabel should be applied in these situations.release_note:*label is applied per the guidelinesbackport:*labels.Identify risks
Does this PR introduce any risks? For example, consider risks like hard to test bugs, performance regression, potential of data loss.
Describe the risk, its severity, and mitigation for each identified risk. Invite stakeholders and evaluate how to proceed before merging.