Fixed usage of isReady for usage collection of alerts and actions#83760
Conversation
|
Pinging @elastic/kibana-alerting-services (Team:Alerting Services) |
gmmorris
left a comment
There was a problem hiding this comment.
I left a few notes about RX usage and inlining the isReady to avoid an intermediary variable.
I'll try and validate my theory about the task potentially stalling, but in either case, we don't want the task to wait on a fresh config every time, so that should be addressed.
💛 Build succeeded, but was flaky
Test FailuresChrome X-Pack UI Functional Tests.x-pack/test/functional/apps/dashboard/drilldowns/dashboard_to_url_drilldown·ts.dashboard drilldowns Dashboard to URL drilldown should create dashboard to URL drilldown and use it to navigate to discoverStandard OutStack TraceMetrics [docs]
History
To update your PR or re-run it, just comment with: |
…lastic#83760) * Fixed usage of `isReady` for usage collection of alerts and actions * fixed index * fixed due to comments * fixed type check * fixed due to comments
* master: (67 commits) [Observability] Load hasData call asynchronously (elastic#80644) Implement AnonymousAuthenticationProvider. (elastic#79985) Deprecate `visualization:colorMapping` advanced setting (elastic#83372) [TSVB] [Rollup] Table tab not working with rollup indexes (elastic#83635) Revert "[Search] Search batching using bfetch (elastic#83418)" (elastic#84037) skip flaky suite (elastic#83772) skip flaky suite (elastic#69849) create kbn-legacy-logging package (elastic#77678) [Search] Search batching using bfetch (elastic#83418) [Security Solution] Refactor Timeline flyout to take a full page (elastic#82033) Drop use of console-stamp (elastic#83922) skip flaky suite (elastic#84011 , elastic#84012) Fixed usage of `isReady` for usage collection of alerts and actions (elastic#83760) [maps] support URL drilldowns (elastic#83732) Revert "Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (elastic#83226)" [code coverage] Update jest config to collect more data (elastic#83804) Added default dedupKey value as an {{alertInstanceId}} to provide grouping functionality for PagerDuty incidents. (elastic#83226) [Security Solution] Give notice when endpoint policy is out of date (elastic#83469) [Security Solution] Sync url state on any changes to query string (elastic#83314) [CI] Initial TeamCity implementation (elastic#81043) ...
pmuellr
left a comment
There was a problem hiding this comment.
Left a question whether the this.kibanaIndexConfig.subscribe() will end up calling the subscriber > 1 times.
| 'actions', | ||
| this.createRouteHandlerContext(core, await this.kibanaIndex) | ||
| ); | ||
| this.kibanaIndexConfig.subscribe((config) => { |
There was a problem hiding this comment.
I noticed that for other uses, we actually only deal with the "first" update of kibanaIndexConfig via kibanaIndexConfig.pipe(first()).toPromise(), but not here.
So it seems like if this.kibanaIndexConfig emits > 1 times per Kibana startup, we'd try to register the routes > 1 times. The same pattern is used in alerts.
Thinking perhaps we should just set kibanaIndexConfig to the following, for consistency, then we can remove the other pipe(first()) usages. Or perhaps I'm missing something.
initContext.config.legacy.globalConfig$.pipe(first())
Current PR includes the changes which make the requirement for actions and alerts collectors to set isReady as true only when the TaskManager plugin will be ready.
Changed alerts plugin setup method to be a synchronous.
Resolve #82947