Skip to content

Commit

Permalink
tentative changes to add more parms to alert executor
Browse files Browse the repository at this point in the history
resolves elastic#50522

There is a soon-to-land PR that changes the files quite a bit
here, but figured worth a commit to know what to do when those PRs
land. PR soon-to-land: elastic#53688
  • Loading branch information
pmuellr committed Jan 3, 2020
1 parent 45e227b commit ae3fc61
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
19 changes: 18 additions & 1 deletion x-pack/legacy/plugins/alerting/server/lib/task_runner_factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,18 @@ export class TaskRunnerFactory {
const services = getServices(fakeRequest);
// Ensure API key is still valid and user has access
const {
attributes: { params, actions, schedule, throttle, muteAll, mutedInstanceIds },
attributes: {
params,
actions,
schedule,
throttle,
muteAll,
mutedInstanceIds,
name,
tags,
createdBy,
updatedBy,
},
references,
} = await services.savedObjectsClient.get<RawAlert>('alert', alertId);

Expand Down Expand Up @@ -144,6 +155,12 @@ export class TaskRunnerFactory {
state: taskInstance.state.alertTypeState || {},
startedAt: taskInstance.startedAt!,
previousStartedAt: taskInstance.state.previousStartedAt,
spaceId,
namespace,
name,
tags,
createdBy,
updatedBy,
});

await Promise.all(
Expand Down
6 changes: 6 additions & 0 deletions x-pack/legacy/plugins/alerting/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export interface AlertExecutorOptions {
services: AlertServices;
params: Record<string, any>;
state: State;
spaceId: string;
namespace: string | undefined;
name: string;
tags: string[];
createdBy: string | null;
updatedBy: string | null;
}

export interface AlertType {
Expand Down

0 comments on commit ae3fc61

Please sign in to comment.