-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Response Ops][Task Manager] Resource based task scheduling - 2nd att…
…empt (#189626) ## Summary Redoing the resource based task claim PR: #187999 and followup PRs #189220 and #189117. Please see the descriptions of those PRs for more details. This was original reverted because unregistered task types in serverless caused the task manager health aggregation to fail. This PR includes an additional commit to exclude unregistered task types from the health report: 58eb2b1. To verify this, make sure you're using the `default` claim strategy, start up Kibana so that the default set of tasks get created. Then either disable a bunch of plugins via config: ``` # remove security and o11y enterpriseSearch.enabled: false xpack.apm.enabled: false xpack.cloudSecurityPosture.enabled: false xpack.fleet.enabled: false xpack.infra.enabled: false xpack.observability.enabled: false xpack.observabilityAIAssistant.enabled: false xpack.observabilityLogsExplorer.enabled: false xpack.search.notebooks.enabled: false xpack.securitySolution.enabled: false xpack.uptime.enabled: false ``` or comment out the task registration of a task that was previously scheduled (I'm using the observability AI assistant) ``` --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/index.ts +++ b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/index.ts @@ -89,24 +89,24 @@ export class ObservabilityAIAssistantService { this.allowInit(); - taskManager.registerTaskDefinitions({ - [INDEX_QUEUED_DOCUMENTS_TASK_TYPE]: { - title: 'Index queued KB articles', - description: - 'Indexes previously registered entries into the knowledge base when it is ready', - timeout: '30m', - maxAttempts: 2, - createTaskRunner: (context) => { - return { - run: async () => { - if (this.kbService) { - await this.kbService.processQueue(); - } - }, - }; - }, - }, - }); + // taskManager.registerTaskDefinitions({ + // [INDEX_QUEUED_DOCUMENTS_TASK_TYPE]: { + // title: 'Index queued KB articles', + // description: + // 'Indexes previously registered entries into the knowledge base when it is ready', + // timeout: '30m', + // maxAttempts: 2, + // createTaskRunner: (context) => { + // return { + // run: async () => { + // if (this.kbService) { + // await this.kbService.processQueue(); + // } + // }, + // }; + // }, + // }, + // }); } ``` and restart Kibana. You should still be able to access the TM health report with the workload field and if you update the background health logging so it always logs and more frequently, you should see the logging succeed with no errors: Below, I've made changes to always log the background health at a 15 second interval: ``` --- a/x-pack/plugins/task_manager/server/plugin.ts +++ b/x-pack/plugins/task_manager/server/plugin.ts @@ -236,6 +236,7 @@ export class TaskManagerPlugin if (this.isNodeBackgroundTasksOnly()) { setupIntervalLogging(monitoredHealth$, this.logger, LogHealthForBackgroundTasksOnlyMinutes); } + setupIntervalLogging(monitoredHealth$, this.logger, LogHealthForBackgroundTasksOnlyMinutes); reduce the logging interval --- a/x-pack/plugins/task_manager/server/lib/log_health_metrics.ts +++ b/x-pack/plugins/task_manager/server/lib/log_health_metrics.ts @@ -35,7 +35,8 @@ export function setupIntervalLogging( monitoredHealth = m; }); - setInterval(onInterval, 1000 * 60 * minutes); + // setInterval(onInterval, 1000 * 60 * minutes); + setInterval(onInterval, 1000 * 15); function onInterval() { ``` --------- Co-authored-by: kibanamachine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
0a01fdd
commit e46e54a
Showing
70 changed files
with
5,092 additions
and
1,546 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
"task_manager" | ||
], | ||
"optionalPlugins": [ | ||
"cloud", | ||
"usageCollection" | ||
] | ||
} | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
10 changes: 10 additions & 0 deletions
10
.../plugins/task_manager/server/integration_tests/__snapshots__/task_cost_check.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.