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

[Response Ops][Alerting] Exposing background worker utilization load metric #153600

Merged
merged 21 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d1bb17f
Adding worker utilization event to calculate load at end of claim cyc…
ymao1 Mar 21, 2023
f5afb6a
Merge branch 'main' into poc/background-task-worker-utilization
kibanamachine Mar 29, 2023
a6f7127
Merge branch 'main' into poc/background-task-worker-utilization
kibanamachine Apr 17, 2023
6b76317
Merge branch 'main' of github.com:elastic/kibana into poc/background-…
ymao1 Apr 20, 2023
cc12288
Merge branch 'main' of github.com:elastic/kibana into poc/background-…
ymao1 Apr 21, 2023
f23d3c8
Cleanup
ymao1 Apr 21, 2023
c518ee6
Merge branch 'poc/background-task-worker-utilization' of github.com:y…
ymao1 Apr 21, 2023
83f22b1
Creating a private and public route
ymao1 Apr 21, 2023
54e0088
Merge branch 'main' of github.com:elastic/kibana into poc/background-…
ymao1 Apr 21, 2023
ae84377
Updating functional tests
ymao1 Apr 21, 2023
09155b1
Fixing types
ymao1 Apr 21, 2023
a6df795
Hardcoding the window size
ymao1 Apr 21, 2023
bd34bcb
Merge branch 'main' into poc/background-task-worker-utilization
kibanamachine Apr 24, 2023
b14c81f
Merge branch 'main' of github.com:elastic/kibana into poc/background-…
ymao1 Apr 25, 2023
1c9971f
Using configurable running average window size
ymao1 Apr 25, 2023
75324dd
Merge branch 'main' into poc/background-task-worker-utilization
kibanamachine May 1, 2023
1fd04ef
Merge branch 'main' into poc/background-task-worker-utilization
kibanamachine May 1, 2023
111c7ea
PR feedback
ymao1 May 2, 2023
a6975e7
PR feedback
ymao1 May 2, 2023
4d798e8
Merge branch 'main' of github.com:elastic/kibana into poc/background-…
ymao1 May 2, 2023
54fd3c3
Adding config to docker allowlist
ymao1 May 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions x-pack/plugins/task_manager/server/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ describe('config validation', () => {
"exclude_task_types": Array [],
},
"version_conflict_threshold": 80,
"worker_utilization_running_average_window": 5,
}
`);
});
Expand Down Expand Up @@ -95,6 +96,7 @@ describe('config validation', () => {
"exclude_task_types": Array [],
},
"version_conflict_threshold": 80,
"worker_utilization_running_average_window": 5,
}
`);
});
Expand Down Expand Up @@ -149,6 +151,7 @@ describe('config validation', () => {
"exclude_task_types": Array [],
},
"version_conflict_threshold": 80,
"worker_utilization_running_average_window": 5,
}
`);
});
Expand Down
12 changes: 10 additions & 2 deletions x-pack/plugins/task_manager/server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ export const DEFAULT_MAX_EPHEMERAL_REQUEST_CAPACITY = MAX_WORKERS_LIMIT;
// ===================
// Refresh aggregated monitored stats at a default rate of once a minute
export const DEFAULT_MONITORING_REFRESH_RATE = 60 * 1000;
export const DEFAULT_MONITORING_STATS_RUNNING_AVERGAE_WINDOW = 50;
export const DEFAULT_MONITORING_STATS_RUNNING_AVERAGE_WINDOW = 50;
export const DEFAULT_MONITORING_STATS_WARN_DELAYED_TASK_START_IN_SECONDS = 60;

// At the default poll interval of 3sec, this averages over the last 15sec.
export const DEFAULT_WORKER_UTILIZATION_RUNNING_AVERAGE_WINDOW = 5;

export const taskExecutionFailureThresholdSchema = schema.object(
{
error_threshold: schema.number({
Expand Down Expand Up @@ -98,7 +101,7 @@ export const configSchema = schema.object(
}),
/* The size of the running average window for monitored stats. */
monitored_stats_running_average_window: schema.number({
defaultValue: DEFAULT_MONITORING_STATS_RUNNING_AVERGAE_WINDOW,
defaultValue: DEFAULT_MONITORING_STATS_RUNNING_AVERAGE_WINDOW,
max: 100,
min: 10,
}),
Expand Down Expand Up @@ -130,6 +133,11 @@ export const configSchema = schema.object(
}),
}),
event_loop_delay: eventLoopDelaySchema,
worker_utilization_running_average_window: schema.number({
defaultValue: DEFAULT_WORKER_UTILIZATION_RUNNING_AVERAGE_WINDOW,
max: 100,
min: 1,
}),
/* These are not designed to be used by most users. Please use caution when changing these */
unsafe: schema.object({
exclude_task_types: schema.arrayOf(schema.string(), { defaultValue: [] }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ describe('EphemeralTaskLifecycle', () => {
monitor: true,
warn_threshold: 5000,
},
worker_utilization_running_average_window: 5,
...config,
},
elasticsearchAndSOAvailability$,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('managed configuration', () => {
monitor: true,
warn_threshold: 5000,
},
worker_utilization_running_average_window: 5,
});
logger = context.logger.get('taskManager');

Expand Down
Loading