[PoC] Discover profile state (local)#13
Closed
davismcphee wants to merge 6 commits into
Closed
Conversation
davismcphee
pushed a commit
that referenced
this pull request
May 26, 2026
## Summary Set `connect.timeout = 60s` on the undici `Agent` used by `KbnClientRequester` (https path only). ## Why elastic#268531 migrated `KbnClient` from axios to native fetch but did not override undici's 10s `connect.timeout` default. Axios had no equivalent cutoff, so FTR callers talking to a busy local Kibana started failing once that PR landed. The `kibana-streams-performance` weekly pipeline went red in builds #9, #11, #12, and #13 with: ``` ConnectTimeoutError: Connect Timeout Error (attempted address: localhost:5620, timeout: 10000ms) ``` The `10000ms` is undici's default. Bisect: build #8 last green (2026-05-11) → #9 first red (2026-05-18), with elastic#268531 in the window. ## What changed `src/platform/packages/shared/kbn-kbn-client/src/kbn_client/kbn_client_requester.ts`: one constant, one option on the https `Agent`. http branch unchanged. ## Related Regression introduced in elastic#268531. Companion streams perf PR: elastic#270636. ## Validation https://buildkite.com/elastic/kibana-streams-performance/builds/14
d60b8ab to
1dd905b
Compare
## Summary
This PR introduces a context awareness toolkit that gives profile
extension points a centralized way to trigger actions in the host
context (add filters, open tabs, update queries, etc.):
```mermaid
flowchart LR
subgraph Hosts["Host creates toolkit"]
MA["Main App"]
EM["Embeddable"]
CP["Context Page"]
end
Hosts --> TK["Toolkit<br/><code>addFilter, openInNewTab,<br/>updateESQLQuery, setExpandedDoc, ...</code>"]
TK --> SPM["ScopedProfilesManager"]
SPM -->|"{ context, toolkit }"| Prof["Profile Accessors<br/><i>cell renderers, chart section,<br/>doc viewer, cell actions, ...</i>"]
Prof -->|"toolkit.actions.*"| Hosts
```
### Why
Profile extension points need to trigger actions in the host app, but
there was no central way to do this. Each host (Discover, embeddable,
surrounding docs) passed actions down through extension point params,
resulting in a lot of duplication and no consistent interface.
### How it works
The toolkit gets injected into profile accessors alongside the existing
`context` param, so extensions receive `(prev, { context, toolkit })`
and can call things like `toolkit.actions.addFilter(...)` directly.
Each host constructs its own toolkit implementation:
- **Main app** — actions dispatch to tab-scoped Redux thunks
- **Embeddable** — actions use dashboard triggers and local state
- **Context page** — actions use the filter manager and React state
This decouples what profiles can do from how each host implements it,
and makes adding new host contexts straightforward. It also lays the
foundation for extensible state management for profiles, which can also
be centralized and exposed via the toolkit.
### Cleanup
- Removes duplicate action implementations across Discover, the
embeddable, and surrounding docs
- Unifies filter handling into a single thunk that supports both
KQL/Lucene and ES|QL WHERE clauses
- Simplifies `DiscoverLayout` by moving filter action code out of the
component
Prep work related to elastic#242987.
### Checklist
- [ ] 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
- [x] [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)
- [x] 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)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
a40ea08 to
8c37532
Compare
Owner
Author
|
Superseded by PR against main branch: elastic#271164. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by PR against main branch: elastic#271164.