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

[Connectors] Detect deploying agentless infra state #205395

Merged

Conversation

jedrazb
Copy link
Member

@jedrazb jedrazb commented Jan 2, 2025

Summary

Let’s start with simple logic to detect the state where we’re waiting for the agentless infrastructure to be provisioned.

In a recent change (elastic/connectors#3014), connectors now send a heartbeat immediately upon the framework’s startup. Therefore, we can use the “last seen” timestamp (populated on heartbeat) to detect when the infrastructure has started.

If we find this logic insufficient to cover all cases, we can adapt the ConnectorViewLogic to also call Fleet APIs for more accurate missing/ready agentless host detection . Let’s keep it simple for now and iterate as needed.

Changes

  • Add logic in ConnectorViewLogic to compute the isWaitingOnAgentlessDeployment state using the last_seen property.
  • In the connector creation flow, add a “Provisioning Infrastructure” banner and disable the “Next Step” button if we’re in this state.
  • In the connector overview, add a warning banner if the infrastructure is not provisioned.
  • Add a few additional fixes in the “Create Connector” form.

Screenshots

  • Create connector form, banner + next button disabled
Screenshot 2025-01-02 at 15 14 56
  • Connector overview banner
Screenshot 2025-01-02 at 15 15 32
  • Form is non-editable after connector doc is created, don't show API key related info for elastic-managed connector
Screenshot 2025-01-02 at 15 25 56

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

@jedrazb jedrazb added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:Search labels Jan 2, 2025
@jedrazb jedrazb requested a review from a team as a code owner January 2, 2025 14:27
@jedrazb jedrazb added the backport:skip This commit does not require backporting label Jan 2, 2025
@jedrazb
Copy link
Member Author

jedrazb commented Jan 7, 2025

@elasticmachine merge upstream

Copy link
Contributor

@navarone-feekery navarone-feekery left a comment

Choose a reason for hiding this comment

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

LGTM, nice one 🚀

@jedrazb jedrazb enabled auto-merge (squash) January 7, 2025 10:10
@jedrazb jedrazb merged commit 23c28eb into elastic:main Jan 7, 2025
9 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
enterpriseSearch 2.6MB 2.6MB +1.8KB

History

kowalczyk-krzysztof pushed a commit to kowalczyk-krzysztof/kibana that referenced this pull request Jan 7, 2025
## Summary

Let’s start with simple logic to detect the state where we’re waiting
for the agentless infrastructure to be provisioned.

In a recent change (elastic/connectors#3014),
connectors now send a heartbeat immediately upon the framework’s
startup. Therefore, we can use the “last seen” timestamp (populated on
heartbeat) to detect when the infrastructure has started.

If we find this logic insufficient to cover all cases, we can adapt the
ConnectorViewLogic to also call Fleet APIs for more accurate
missing/ready agentless host detection . Let’s keep it simple for now
and iterate as needed.

### Changes
- Add logic in ConnectorViewLogic to compute the
isWaitingOnAgentlessDeployment state using the last_seen property.
- In the connector creation flow, add a “Provisioning Infrastructure”
banner and disable the “Next Step” button if we’re in this state.
- In the connector overview, add a warning banner if the infrastructure
is not provisioned.
- Add a few additional fixes in the “Create Connector” form.

### Screenshots

- Create connector form, banner + next button disabled
<img width="1265" alt="Screenshot 2025-01-02 at 15 14 56"
src="https://github.com/user-attachments/assets/32b224ae-8008-429e-a940-39bf038a03dc"
/>

- Connector overview banner
<img width="1280" alt="Screenshot 2025-01-02 at 15 15 32"
src="https://github.com/user-attachments/assets/d29bccf6-b6ed-48ab-9b58-076c3962ad36"
/>

- Form is non-editable after connector doc is created, don't show API
key related info for elastic-managed connector
<img width="1296" alt="Screenshot 2025-01-02 at 15 25 56"
src="https://github.com/user-attachments/assets/766a1fd7-cef3-4437-8140-4559f8cf5de1"
/>


### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] 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/packages/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
- [x] 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)

---------

Co-authored-by: Elastic Machine <[email protected]>
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:Search v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants