forked from opensearch-project/alerting-dashboards-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented a toast to display successful attempts to acknowledge ale…
…rts. Refactored alerts dashboard flyout to refresh its alerts table when alerts are acknowledged. (opensearch-project#160) * Implemented unit and integ tests for the alerts dashboard flyout. Refactored AlertsDashboardFlyoutComponent::getBucketLevelGraphConditions to return a string with line breaks instead of an array of HTML elements. Signed-off-by: AWSHurneyt <[email protected]> Signed-off-by: AWSHurneyt <[email protected]> * Removed an unused test variable. Signed-off-by: AWSHurneyt <[email protected]> * Removed debug logs. Signed-off-by: AWSHurneyt <[email protected]> * Implemented unit test. Refactored integration tests to use fewer wait periods. Signed-off-by: AWSHurneyt <[email protected]> * Examining flakiness in cypress test. Signed-off-by: AWSHurneyt <[email protected]> * Added short wait period to flyout cypress tests to alleviate flakiness. Signed-off-by: AWSHurneyt <[email protected]> * Refactored flyout cypress tests to use aliases. Signed-off-by: AWSHurneyt <[email protected]>
- Loading branch information
1 parent
60f4ef2
commit 9f71182
Showing
15 changed files
with
2,181 additions
and
356 deletions.
There are no files selected for viewing
134 changes: 134 additions & 0 deletions
134
cypress/fixtures/sample_alerts_flyout_bucket_level_monitor.json
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 |
---|---|---|
@@ -0,0 +1,134 @@ | ||
{ | ||
"name": "sample_alerts_flyout_bucket_level_monitor", | ||
"type": "monitor", | ||
"monitor_type": "bucket_level_monitor", | ||
"enabled": true, | ||
"schedule": { | ||
"period": { | ||
"unit": "MINUTES", | ||
"interval": 1 | ||
} | ||
}, | ||
"inputs": [ | ||
{ | ||
"search": { | ||
"indices": ["opensearch_dashboards_sample_data_ecommerce"], | ||
"query": { | ||
"size": 0, | ||
"aggregations": { | ||
"composite_agg": { | ||
"composite": { | ||
"sources": [ | ||
{ | ||
"customer_gender": { | ||
"terms": { | ||
"field": "customer_gender" | ||
} | ||
} | ||
}, | ||
{ | ||
"user": { | ||
"terms": { | ||
"field": "user" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"aggs": { | ||
"avg_products_price": { | ||
"avg": { | ||
"field": "products.price" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"query": { | ||
"bool": { | ||
"filter": [ | ||
{ | ||
"range": { | ||
"order_date": { | ||
"gte": "{{period_end}}||-10d", | ||
"lte": "{{period_end}}", | ||
"format": "epoch_millis" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"triggers": [ | ||
{ | ||
"bucket_level_trigger": { | ||
"id": "JHpsfH0BYHgJ26-yS5n7", | ||
"name": "sample_alerts_flyout_bucket_level_trigger", | ||
"severity": "4", | ||
"condition": { | ||
"buckets_path": { | ||
"_count": "_count", | ||
"avg_products_price": "avg_products_price" | ||
}, | ||
"parent_bucket_path": "composite_agg", | ||
"script": { | ||
"source": "params._count < 10000 || params.avg_products_price == 10", | ||
"lang": "painless" | ||
}, | ||
"gap_policy": "skip" | ||
}, | ||
"actions": [] | ||
} | ||
} | ||
], | ||
"ui_metadata": { | ||
"schedule": { | ||
"timezone": null, | ||
"frequency": "interval", | ||
"period": { | ||
"unit": "MINUTES", | ||
"interval": 1 | ||
}, | ||
"daily": 0, | ||
"weekly": { | ||
"tue": false, | ||
"wed": false, | ||
"thur": false, | ||
"sat": false, | ||
"fri": false, | ||
"mon": false, | ||
"sun": false | ||
}, | ||
"monthly": { | ||
"type": "day", | ||
"day": 1 | ||
}, | ||
"cronExpression": "0 */1 * * *" | ||
}, | ||
"search": { | ||
"searchType": "graph", | ||
"timeField": "order_date", | ||
"aggregations": [ | ||
{ | ||
"aggregationType": "avg", | ||
"fieldName": "products.price" | ||
} | ||
], | ||
"groupBy": ["customer_gender", "user"], | ||
"bucketValue": 10, | ||
"bucketUnitOfTime": "d", | ||
"where": { | ||
"fieldName": [], | ||
"fieldRangeEnd": 0, | ||
"fieldRangeStart": 0, | ||
"fieldValue": "", | ||
"operator": "is" | ||
} | ||
}, | ||
"monitor_type": "bucket_level_monitor" | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
cypress/fixtures/sample_alerts_flyout_query_level_monitor.json
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 |
---|---|---|
@@ -0,0 +1,101 @@ | ||
{ | ||
"name": "sample_alerts_flyout_query_level_monitor", | ||
"type": "monitor", | ||
"monitor_type": "query_level_monitor", | ||
"enabled": true, | ||
"schedule": { | ||
"period": { | ||
"unit": "MINUTES", | ||
"interval": 1 | ||
} | ||
}, | ||
"inputs": [ | ||
{ | ||
"search": { | ||
"indices": ["opensearch_dashboards_sample_data_ecommerce"], | ||
"query": { | ||
"size": 0, | ||
"aggregations": { | ||
"terms_agg": { | ||
"terms": { | ||
"field": "user" | ||
} | ||
} | ||
}, | ||
"query": { | ||
"bool": { | ||
"filter": [ | ||
{ | ||
"range": { | ||
"order_date": { | ||
"gte": "{{period_end}}||-10d", | ||
"lte": "{{period_end}}", | ||
"format": "epoch_millis" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"triggers": [ | ||
{ | ||
"query_level_trigger": { | ||
"id": "YHpufH0BYHgJ26-yhJm-", | ||
"name": "sample_alerts_flyout_query_level_trigger", | ||
"severity": "2", | ||
"condition": { | ||
"script": { | ||
"source": "ctx.results[0].hits.total.value < 10000", | ||
"lang": "painless" | ||
} | ||
}, | ||
"actions": [] | ||
} | ||
} | ||
], | ||
"ui_metadata": { | ||
"schedule": { | ||
"timezone": null, | ||
"frequency": "interval", | ||
"period": { | ||
"unit": "MINUTES", | ||
"interval": 1 | ||
}, | ||
"daily": 0, | ||
"weekly": { | ||
"tue": false, | ||
"wed": false, | ||
"thur": false, | ||
"sat": false, | ||
"fri": false, | ||
"mon": false, | ||
"sun": false | ||
}, | ||
"monthly": { | ||
"type": "day", | ||
"day": 1 | ||
}, | ||
"cronExpression": "0 */1 * * *" | ||
}, | ||
"search": { | ||
"searchType": "graph", | ||
"timeField": "order_date", | ||
"aggregations": [], | ||
"groupBy": ["user"], | ||
"bucketValue": 10, | ||
"bucketUnitOfTime": "d", | ||
"where": { | ||
"fieldName": [], | ||
"fieldRangeEnd": 0, | ||
"fieldRangeStart": 0, | ||
"fieldValue": "", | ||
"operator": "is" | ||
} | ||
}, | ||
"monitor_type": "query_level_monitor" | ||
} | ||
} |
Oops, something went wrong.