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

Composite monitors #611

Merged
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
28b8162
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 9, 2023
c068abd
Merge branch 'main' of https://github.com/opensearch-project/alerting…
jovancvetkovic3006 Jun 9, 2023
11b5b0d
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 15, 2023
a8aa47a
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 15, 2023
83d6eb6
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 16, 2023
567db1d
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 16, 2023
f6b39fe
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 18, 2023
2201c0e
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 19, 2023
654a5f1
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 19, 2023
39b4d0d
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 19, 2023
be4b4bf
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 19, 2023
1792d4c
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 19, 2023
e60c4ff
Merge branch 'main' of https://github.com/opensearch-project/alerting…
jovancvetkovic3006 Jun 19, 2023
8e5723b
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 20, 2023
12f0e6f
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 20, 2023
88d7ac9
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 20, 2023
11ebb8d
[FEATURE] Add composite monitor type #573
jovancvetkovic3006 Jun 21, 2023
59ec9d1
new columns with deletion modal for monitors list; added condition co…
amsiglan Jun 22, 2023
727a692
Code review #573
jovancvetkovic3006 Jun 22, 2023
bf802c1
Code review #573
jovancvetkovic3006 Jun 22, 2023
475807f
Code review #573
jovancvetkovic3006 Jun 22, 2023
c796666
Code review #573
jovancvetkovic3006 Jun 22, 2023
2ad090a
Code review #573
jovancvetkovic3006 Jun 22, 2023
bcd173b
Code review #573
jovancvetkovic3006 Jun 22, 2023
8a02403
Code review #573
jovancvetkovic3006 Jun 22, 2023
87829fd
Code review #573
jovancvetkovic3006 Jun 22, 2023
4e66dd9
Code review #573
jovancvetkovic3006 Jun 22, 2023
277506e
Code review #573
jovancvetkovic3006 Jun 22, 2023
64aca92
Code review #573
jovancvetkovic3006 Jun 22, 2023
f989735
Code review #573
jovancvetkovic3006 Jun 22, 2023
a80bb3d
Merge remote-tracking branch 'jovan/composite_monitors' into composit…
amsiglan Jun 22, 2023
ed738c8
Code review #573
jovancvetkovic3006 Jun 23, 2023
5a7fe5e
Code review #573
jovancvetkovic3006 Jun 23, 2023
b43dda7
Code review #573
jovancvetkovic3006 Jun 23, 2023
5b01da5
Code review #573
jovancvetkovic3006 Jun 23, 2023
c806609
Code review #573
jovancvetkovic3006 Jun 23, 2023
77c23d7
Code review #573
jovancvetkovic3006 Jun 23, 2023
fa03e0f
Code review #573
jovancvetkovic3006 Jun 23, 2023
5ec5aad
Code review #573
jovancvetkovic3006 Jun 23, 2023
a9cef2e
Code review #573
jovancvetkovic3006 Jun 23, 2023
c9df028
Cypress tests
jovancvetkovic3006 Jun 26, 2023
dcedac0
Cypress tests
jovancvetkovic3006 Jun 26, 2023
ed1bef7
Unit tests
jovancvetkovic3006 Jun 27, 2023
308b70c
Unit tests
jovancvetkovic3006 Jun 27, 2023
fa4f600
Add visual editor callout message for advanced conditions
jovancvetkovic3006 Jun 27, 2023
43c689f
Add visual editor callout message for advanced conditions
jovancvetkovic3006 Jun 27, 2023
314c47e
Add visual editor callout message for advanced conditions
jovancvetkovic3006 Jun 27, 2023
bd403f3
auto add cinditions when associated monitor is selected
jovancvetkovic3006 Jun 27, 2023
18f548e
getting associated monitors count
amsiglan Jun 27, 2023
37e2e8b
Merge remote-tracking branch 'jovan/composite_monitors' into composit…
amsiglan Jun 27, 2023
e0f9abb
Merge remote-tracking branch 'jovan/composite_monitors_follow_up' int…
amsiglan Jun 27, 2023
5f689d5
ux updates
amsiglan Jun 28, 2023
06584f6
Adds multiple triggers
jovancvetkovic3006 Jun 28, 2023
335b87c
Adds multiple triggers
jovancvetkovic3006 Jun 28, 2023
abaa7e5
Adds multiple triggers
jovancvetkovic3006 Jun 28, 2023
0f560a6
Adds multiple triggers
jovancvetkovic3006 Jun 28, 2023
cdf168f
Adds multiple triggers
jovancvetkovic3006 Jun 28, 2023
3a3578f
integrated all apis; monitor deletion added
amsiglan Jun 30, 2023
f5265fc
fixed delete modal
amsiglan Jun 30, 2023
3f29148
fixed ux issues from bug bash
amsiglan Jul 7, 2023
5d5e236
addressed UX feedback
amsiglan Jul 11, 2023
c918bb8
merged main
amsiglan Jul 11, 2023
b6d6593
fixed monitor service
amsiglan Jul 11, 2023
531f0c1
fixed build error; schedule
amsiglan Jul 11, 2023
9cde458
updated snapshots
amsiglan Jul 11, 2023
07e9116
addressed PR comments; changed description texts
amsiglan Jul 11, 2023
a492813
fixed cypress tests
amsiglan Jul 11, 2023
2c363ec
updated cypress tests
amsiglan Jul 11, 2023
e2204d5
removed commented code
amsiglan Jul 11, 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
274 changes: 274 additions & 0 deletions cypress/fixtures/sample_composite_level_monitor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
{
"sample_composite_monitor": {
"type": "workflow",
"schema_version": 0,
"name": "sampleComponentLevelMonitor",
"workflow_type": "composite",
"enabled": true,
"enabled_time": 1686908176848,
"schedule": {
"period": {
"interval": 1,
"unit": "MINUTES"
}
},
"inputs": [
{
"composite_input": {
"sequence": {
"delegates": [
{
"order": 1,
"monitor_id": "qdYBw4gB2qeAWe54jQyZ"
},
{
"order": 2,
"monitor_id": "rtYBw4gB2qeAWe54wAx5"
}
AWSHurneyt marked this conversation as resolved.
Show resolved Hide resolved
]
}
}
}
],
"triggers": [
{
"chained_alert_trigger": {
"id": "pNaQw4gB2qeAWe54Fg2U",
"name": "sample_trigger",
"severity": "1",
"condition": {
"script": {
"source": "(monitor[id=qdYBw4gB2qeAWe54jQyZ]) && (monitor[id=rtYBw4gB2qeAWe54wAx5])",
"lang": "painless"
}
},
"actions": [
{
"id": "pdaQw4gB2qeAWe54Fg2U",
"name": "sample_channel",
"destination_id": "6dYFw4gB2qeAWe54NgyL",
"message_template": {
"source": "Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue.\n - Trigger: {{ctx.trigger.name}}\n - Severity: {{ctx.trigger.severity}}\n - Period start: {{ctx.periodStart}}\n - Period end: {{ctx.periodEnd}}",
"lang": "mustache"
},
"throttle_enabled": false,
"subject_template": {
"source": "Monitor {{ctx.monitor.name}} triggered an alert {{ctx.trigger.name}}",
"lang": "mustache"
}
}
]
}
}
],
"last_update_time": 1686908180116,
"owner": "alerting",
"monitor_type": "composite"
},
"sample_composite_index": {
"mappings": {
"properties": {
"audit_category": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"audit_node_host_name": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"audit_node_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
},
"sample_composite_associated_monitor_1": {
"name": "monitorOne",
"type": "monitor",
"monitor_type": "doc_level_monitor",
"enabled": false,
"schedule": {
"period": {
"unit": "MINUTES",
"interval": 1
}
},
"inputs": [
{
"doc_level_input": {
"description": "",
"indices": ["sample_index_1"],
"queries": [
{
"id": "monitor_1_query_1",
"name": "monitor_1_query_1",
"query": "NOT (audit_category:\"sample_text\")",
"tags": []
},
{
"id": "monitor_1_query_2",
"name": "monitor_1_query_2",
"query": "NOT (audit_node_host_name:\"sample_text\")",
"tags": []
},
{
"id": "monitor_1_query_3",
"name": "monitor_1_query_3",
"query": "NOT (audit_node_id:\"sample_text\")",
"tags": []
}
]
}
}
],
"triggers": [
{
"document_level_trigger": {
"id": "sample_trigger_id_1",
"name": "monitor_1_query_2",
"severity": "1",
"condition": {
"script": {
"source": "query[name=monitor_1_query_1] || query[name=monitor_1_query_2] && query[name=monitor_1_query_3]",
"lang": "painless"
}
},
"actions": []
}
}
]
},
"sample_composite_associated_monitor_2": {
"name": "monitorTwo",
"type": "monitor",
"monitor_type": "doc_level_monitor",
"enabled": false,
"schedule": {
"period": {
"unit": "MINUTES",
"interval": 1
}
},
"inputs": [
{
"doc_level_input": {
"description": "",
"indices": ["sample_index_2"],
"queries": [
{
"id": "monitor_2_query_1",
"name": "monitor_2_query_1",
"query": "NOT (audit_category:\"sample_text\")",
"tags": []
},
{
"id": "monitor_2_query_2",
"name": "monitor_2_query_2",
"query": "NOT (audit_node_host_name:\"sample_text\")",
"tags": []
},
{
"id": "monitor_2_query_3",
"name": "monitor_2_query_3",
"query": "NOT (audit_node_id:\"sample_text\")",
"tags": []
}
]
}
}
],
"triggers": [
{
"document_level_trigger": {
"id": "sample_trigger_2",
"name": "monitor_2_query_2",
"severity": "1",
"condition": {
"script": {
"source": "query[name=monitor_2_query_1] || query[name=monitor_2_query_2] && query[name=monitor_2_query_3]",
"lang": "painless"
}
},
"actions": []
}
}
]
},
"sample_composite_associated_monitor_3": {
"name": "monitorThree",
"type": "monitor",
"monitor_type": "doc_level_monitor",
"enabled": false,
"schedule": {
"period": {
"unit": "MINUTES",
"interval": 1
}
},
"inputs": [
{
"doc_level_input": {
"description": "",
"indices": ["sample_index_2"],
"queries": [
{
"id": "monitor_2_query_1",
"name": "monitor_2_query_1",
"query": "NOT (audit_category:\"sample_text\")",
"tags": []
},
{
"id": "monitor_2_query_2",
"name": "monitor_2_query_2",
"query": "NOT (audit_node_host_name:\"sample_text\")",
"tags": []
},
{
"id": "monitor_2_query_3",
"name": "monitor_2_query_3",
"query": "NOT (audit_node_id:\"sample_text\")",
"tags": []
}
]
}
}
],
"triggers": [
{
"document_level_trigger": {
"id": "sample_trigger_2",
"name": "monitor_2_query_2",
"severity": "1",
"condition": {
"script": {
"source": "query[name=monitor_2_query_1] || query[name=monitor_2_query_2] && query[name=monitor_2_query_3]",
"lang": "painless"
}
},
"actions": []
}
}
]
},
"sample_composite_associated_index_document": {
"audit_category": "FAILED_LOGIN",
"audit_node_host_name": "127.0.0.1",
"audit_node_id": "sample_node_id"
}
}
1 change: 1 addition & 0 deletions cypress/integration/acknowledge_alerts_modal_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const TWENTY_SECONDS = 20000;
describe('AcknowledgeAlertsModal', () => {
before(() => {
// Delete any existing monitors
cy.deleteAllAlerts();
cy.deleteAllMonitors();

// Load sample data
Expand Down
Loading