[Fleet] OpAMP UI changes#252541
Conversation
| sequence_num: hit._source?.sequence_num, | ||
| capabilities: hit._source?.capabilities, | ||
| health: hit._source?.health, | ||
| effective_config: hit._source?.effective_config, |
There was a problem hiding this comment.
Alternatively we could omit effective_config from here (to be returned in the /agents API) and have a separate API call to return effective_config only when View Collector Configuration is clicked.
This would reduce the size of /agents` API responses, as effective config can be quite large.
There was a problem hiding this comment.
Decided to move out effective_config to another API, as we call the /agents API many times, so it's better to query effective_config only when the button is clicked.
florent-leborgne
left a comment
There was a problem hiding this comment.
LGTM for docs; 2 minor suggestions that you can feel free to ignore on the copy
...ctions/agents/agent_details_page/components/agent_details/agent_details_component_health.tsx
Outdated
Show resolved
Hide resolved
...ations/fleet/sections/agents/agent_details_page/components/agent_effective_config_flyout.tsx
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/fleet (Team:Fleet) |
nchaulet
left a comment
There was a problem hiding this comment.
I did a first code only pass, looks good
|
|
||
| export function removeSOAttributes(kuery: string) { | ||
| return kuery.replace(/attributes\./g, '').replace(/fleet-agents\./g, ''); | ||
| return kuery.replace(/\.attributes\./g, '').replace(/fleet-agents\./g, ''); |
There was a problem hiding this comment.
nit: it will be great to add a unit test for that with the property that was breaking, it will serve as documentation and avoid we break it later
There was a problem hiding this comment.
added unit tests
| fleetAgents = await _fetchAndAssignAgentMetrics(esClient, fleetAgents); | ||
| opampAgents = await _fetchAndAssignOtelMetrics(esClient, opampAgents); | ||
| return [...fleetAgents, ...opampAgents]; |
There was a problem hiding this comment.
In case where we have mixed fleetAgent and opampAgents this could messed up the order now?
There was a problem hiding this comment.
refactored to keep the agent order
| }); | ||
| }; | ||
|
|
||
| export const AgentDetailsComponentHealth: React.FunctionComponent<{ |
There was a problem hiding this comment.
Nit: if that component is only used for opamp maybe have some distinctive naming
There was a problem hiding this comment.
good point, renamed
| const esClient = appContextService.getInternalUserESClient(); | ||
| const agentDoc = await esClient.get({ | ||
| index: AGENTS_INDEX, | ||
| id: request.params.agentId, |
There was a problem hiding this comment.
I guess opamp agent could belong to different space depending of the policy space, we may need a check that agent belong to the current space here (maybe just retrieving the agent will do the trick)
There was a problem hiding this comment.
added verification for current space
…/sections/agents/agent_details_page/components/agent_details/agent_details_component_health.tsx Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
…/sections/agents/agent_details_page/components/agent_effective_config_flyout.tsx Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
There was a problem hiding this comment.
⏳ Build in-progress, with failures
Failed CI StepsTest Failures
History
|
| const isOutdated = agent?.policy_revision && policy.revision > agent.policy_revision; | ||
|
|
||
| if (agent?.type === 'OPAMP') { | ||
| return <EuiText>-</EuiText>; |
## Summary Relates elastic/ingest-dev#6829 Closes elastic/ingest-dev#6982 Depends on elastic/fleet-server#6330 Follow the instructions in the fleet-server PR to start an otel collector with OpAMP config. OTel Collector displayed in Fleet UI including: - Capabilities - Component Health - Effective Config (click on View Collector Configuration) - Link to OTel internal dashboard (click on View more agent metrics) elastic/opentelemetry-dev#1038 - Calculate CPU and Memory metrics from internal telemetry for OTel collectors Added `.fleet-agents` mappings for the new fields to be searchable (e.g. identifying attributes): elastic/elasticsearch#142550 https://github.com/user-attachments/assets/a0a30e31-c7cd-456b-9004-4002c36c46fe <img width="1245" height="864" alt="image" src="https://github.com/user-attachments/assets/8c092c76-a789-4ddb-8265-3191268cfb80" /> <img width="1249" height="861" alt="image" src="https://github.com/user-attachments/assets/ae9e0835-cbe4-4ed5-b3ab-d0720d8775e8" /> <img width="1802" height="623" alt="image" src="https://github.com/user-attachments/assets/0256693f-6da9-457a-a363-1d8e54d94973" /> <img width="1245" height="852" alt="image" src="https://github.com/user-attachments/assets/d1cec06f-9116-40cc-ba65-da42e16b6f12" /> <img width="1752" height="626" alt="image" src="https://github.com/user-attachments/assets/d190065a-b4be-4682-b1ff-6314a4ada9c8" /> ### 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: florent-leborgne <florent.leborgne@elastic.co>
## 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
Relates https://github.com/elastic/ingest-dev/issues/6829
Closes https://github.com/elastic/ingest-dev/issues/6982
Depends on elastic/fleet-server#6330
Follow the instructions in the fleet-server PR to start an otel collector with OpAMP config.
OTel Collector displayed in Fleet UI including:
Added
.fleet-agentsmappings for the new fields to be searchable (e.g. identifying attributes): elastic/elasticsearch#142550OpAMP_UI.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.