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

Aligns Alerting's interval with TaskManager's generic schedule field #52873

Merged
merged 73 commits into from
Dec 18, 2019
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
418b946
refactor(task-manager): declaritively construct markAvailableTasksAsC…
gmmorris Nov 25, 2019
3ed64ed
refactor(task-manager): made TM constructor a little more legible
gmmorris Nov 25, 2019
5427350
feat(run-now): Added TaskEvent when tasks are claimed in TaskStore
gmmorris Nov 27, 2019
9041b18
feat(run-now): Use streams in TaskPoller to make it easier to push va…
gmmorris Nov 28, 2019
c2698e4
Merge branch 'master' into task-manager/run-now
gmmorris Nov 28, 2019
112227e
refactor(run-now): switch to simple mock of rxjs instead of importing…
gmmorris Nov 28, 2019
a01f110
expone runNow api on TaskManager
gmmorris Dec 2, 2019
2a6ea1f
refactored EvenTypes and how we process the run result of a task
gmmorris Dec 2, 2019
09c920f
Merge branch 'master' into task-manager/run-now
elasticmachine Dec 3, 2019
5e979b3
refactored task running result processing
gmmorris Dec 3, 2019
90c9538
Merge branch 'task-manager/run-now' of github.com:gmmorris/kibana int…
gmmorris Dec 3, 2019
6a6b3c8
handle runNow of nonexistent tasks
gmmorris Dec 3, 2019
8e83283
added waitOnceForEvent in SampleTask to clean up tests
gmmorris Dec 4, 2019
08bd67f
enable running a failed task using runNow
gmmorris Dec 4, 2019
07d1a4c
Merge branch 'master' into task-manager/run-now
gmmorris Dec 4, 2019
3a9f82f
added documentation
gmmorris Dec 4, 2019
f4a4d28
remodeled poller using streams of push events
gmmorris Dec 5, 2019
f697fb6
Merge branch 'master' into task-manager/run-now
gmmorris Dec 5, 2019
a466940
cleaned up runNow method
gmmorris Dec 6, 2019
4de72c1
extracted runNow handler for improved testing
gmmorris Dec 6, 2019
92a2ad4
fixed broken types
gmmorris Dec 6, 2019
bacbf4a
improved doc and type signature
gmmorris Dec 9, 2019
e794ff6
brought back perf marking in pooler
gmmorris Dec 9, 2019
f0f4703
removed unneeded second buffer
gmmorris Dec 9, 2019
f403781
throw error when a requests comes in but the request buffer is at cap…
gmmorris Dec 10, 2019
a1e1cd2
Merge branch 'master' into task-manager/run-now
gmmorris Dec 10, 2019
56baa6d
fixed types and typo
gmmorris Dec 10, 2019
73043bc
fixed TaskStatus usage
gmmorris Dec 10, 2019
4a3ba2a
Merge branch 'master' into task-manager/run-now
gmmorris Dec 10, 2019
3a4f588
corrected doc
gmmorris Dec 10, 2019
55c2dfc
cleaned up TM constructor
gmmorris Dec 10, 2019
9513419
improved documentation
gmmorris Dec 10, 2019
4266303
fixed edgecase where execution could fail i nthe poller
gmmorris Dec 10, 2019
d42e040
moved intialisations in TaskManager
gmmorris Dec 11, 2019
dc6c299
removed unneccesery null guard
gmmorris Dec 11, 2019
b5b638a
Merge branch 'task-manager/run-now' into task-manager/interval-to-sch…
gmmorris Dec 11, 2019
f5fc2e3
renames interval to recurringSchedule
gmmorris Dec 11, 2019
bd0cb96
added support for interval as a deprecated field
gmmorris Dec 11, 2019
1a09f3c
added missing tests for pull from set
gmmorris Dec 11, 2019
8110979
Merge branch 'master' into task-manager/interval-to-scheduling
elasticmachine Dec 11, 2019
0908097
Merge branch 'master' into task-manager/run-now
elasticmachine Dec 11, 2019
7741559
Merge branch 'master' into task-manager/run-now
elasticmachine Dec 11, 2019
f36dbc5
moved interval under schedule key
gmmorris Dec 12, 2019
47cb586
Merge branch 'task-manager/interval-to-scheduling' of github.com:gmmo…
gmmorris Dec 12, 2019
31f751e
make interval field a keyword so we can search on it i nthe future
gmmorris Dec 12, 2019
0213ea3
moved interval field into generic schedul object on alerts
gmmorris Dec 12, 2019
a7c651e
update siem to use the new shcedule object
gmmorris Dec 12, 2019
5b89c36
Merge branch 'master' into task-manager/run-now
gmmorris Dec 12, 2019
9ea13d9
Merge branch 'task-manager/run-now' of github.com:gmmorris/kibana int…
gmmorris Dec 12, 2019
1d0f1bd
change comment in SIEM code to make clear why were using a cast
gmmorris Dec 12, 2019
6ae62e2
log a warning whenever the deprecated interval is used
gmmorris Dec 12, 2019
63d2ac2
typo
gmmorris Dec 12, 2019
79c6d68
use logger in deprecation check
gmmorris Dec 12, 2019
5d603be
Merge branch 'master' into task-manager/interval-to-scheduling
elasticmachine Dec 12, 2019
6cc4c9b
cleaned up comment on poller
gmmorris Dec 12, 2019
45718dd
limit subject api by typing as observable
gmmorris Dec 13, 2019
2c697d6
Merge branch 'master' into task-manager/interval-to-scheduling
gmmorris Dec 13, 2019
a54f0b1
simplified scan in poller
gmmorris Dec 13, 2019
160076e
Merge branch 'master' into task-manager/run-now
gmmorris Dec 13, 2019
1011cc6
Merge branch 'task-manager/run-now' into task-manager/interval-to-sch…
gmmorris Dec 13, 2019
03ddf9c
Merge branch 'master' into task-manager/run-now
elasticmachine Dec 13, 2019
2039e5e
Merge branch 'master' into task-manager/run-now
gmmorris Dec 16, 2019
69819fe
Merge branch 'task-manager/run-now' into task-manager/interval-to-sch…
gmmorris Dec 16, 2019
8b2141c
Merge branch 'task-manager/interval-to-scheduling' into alerting/inte…
gmmorris Dec 16, 2019
f9abfd6
Merge branch 'alerting/interval-to-schedule' of github.com:gmmorris/k…
gmmorris Dec 16, 2019
6a472c9
Merge branch 'master' into task-manager/interval-to-scheduling
gmmorris Dec 16, 2019
8b49f74
Merge branch 'task-manager/interval-to-scheduling' into alerting/inte…
gmmorris Dec 16, 2019
9aa684c
improve meessaging on cast
gmmorris Dec 16, 2019
30e1ad8
fixed naming
gmmorris Dec 17, 2019
8cd60ee
Merge branch 'task-manager/interval-to-scheduling' into alerting/inte…
gmmorris Dec 17, 2019
9c87312
Merge branch 'master' into alerting/interval-to-schedule
gmmorris Dec 17, 2019
9956ce0
Update x-pack/legacy/plugins/alerting/README.md
gmmorris Dec 18, 2019
d477b45
Merge branch 'master' into alerting/interval-to-schedule
elasticmachine Dec 18, 2019
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
12 changes: 10 additions & 2 deletions x-pack/legacy/plugins/alerting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Payload:
|name|A name to reference and search in the future.|string|
|tags|A list of keywords to reference and search in the future.|string[]|
|alertTypeId|The id value of the alert type you want to call when the alert is scheduled to execute.|string|
|interval|The interval in seconds, minutes, hours or days the alert should execute. Example: `10s`, `5m`, `1h`, `1d`.|string|
|schedule|The schedule specifying when this alert should be run, using one of the available schedule formats specified under _Schedule Formats_ below|object|
gmmorris marked this conversation as resolved.
Show resolved Hide resolved
|params|The parameters to pass in to the alert type executor `params` value. This will also validate against the alert type params validator if defined.|object|
|actions|Array of the following:<br> - `group` (string): We support grouping actions in the scenario of escalations or different types of alert instances. If you don't need this, feel free to use `default` as a value.<br>- `id` (string): The id of the action saved object to execute.<br>- `params` (object): The map to the `params` the action type will receive. In order to help apply context to strings, we handle them as mustache templates and pass in a default set of context. (see templating actions).|array|

Expand Down Expand Up @@ -242,7 +242,7 @@ Payload:

|Property|Description|Type|
|---|---|---|
|interval|The interval in seconds, minutes, hours or days the alert should execute. Example: `10s`, `5m`, `1h`, `1d`.|string|
|schedule|The schedule specifying when this alert should be run, using one of the available schedule formats specified under _Schedule Formats_ below|object|
|name|A name to reference and search in the future.|string|
|tags|A list of keywords to reference and search in the future.|string[]|
|params|The parameters to pass in to the alert type executor `params` value. This will also validate against the alert type params validator if defined.|object|
Expand Down Expand Up @@ -304,6 +304,14 @@ Params:
|---|---|---|
|id|The id of the alert you're trying to update the API key for. System will use user in request context to generate an API key for.|string|

##### Schedule Formats
A schedule is structured such that the key specifies the format you wish to use and its value specifies the schedule.

We currently support the _Interval format_ which specifies the interval in seconds, minutes, hours or days at which the alert should execute.
Example: `{ interval: "10s" }`, `{ interval: "5m" }`, `{ interval: "1h" }`, `{ interval: "1d" }`.

There are plans to support multiple other schedule formats in the near fuiture.

## Alert instance factory

**alertInstanceFactory(id)**
Expand Down
8 changes: 6 additions & 2 deletions x-pack/legacy/plugins/alerting/mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
"alertTypeId": {
"type": "keyword"
},
"interval": {
"type": "keyword"
"schedule": {
"properties": {
"interval": {
"type": "keyword"
}
}
},
"actions": {
"type": "nested",
Expand Down
Loading