-
Notifications
You must be signed in to change notification settings - Fork 113
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
Onboard alerting dashboards plugin #103
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
abea290
Initial commit for alerting cypress tests
144cf15
Add SNS destination test to destination_spec.js
a38b42e
Add alerting cypress tests
ba0e92d
Update env variable
450360b
Update destination_spec.js
182c134
Update variables
7000325
Update alert_spec.js
3bef7ac
Remove cypress tests other than destination
7d5bd8c
Add managed service domain flag
1e581db
Update destination_spec.js
64a71cb
Merge remote-tracking branch 'upstream/main' into alerting-sns
3ddddc9
Merge remote-tracking branch 'upstream/main' into alerting-sns
52eae28
Update alerting constants and add description for managed service dom…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
41 changes: 41 additions & 0 deletions
41
cypress/fixtures/plugins/alerting-dashboards-plugin/sample_aggregation_query.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,41 @@ | ||
{ | ||
"size": 0, | ||
"query": { | ||
"bool": { | ||
"filter": [ | ||
{ | ||
"range": { | ||
"order_date": { | ||
"from": "{{period_end}}||-1h", | ||
"to": "{{period_end}}", | ||
"include_lower": true, | ||
"include_upper": true, | ||
"format": "epoch_millis", | ||
"boost": 1.0 | ||
} | ||
} | ||
} | ||
], | ||
"adjust_pure_negative": true, | ||
"boost": 1.0 | ||
} | ||
}, | ||
"aggregations": { | ||
"composite_agg": { | ||
"composite": { | ||
"size": 10, | ||
"sources": [ | ||
{ | ||
"user": { | ||
"terms": { | ||
"field": "user", | ||
"missing_bucket": false, | ||
"order": "asc" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
134 changes: 134 additions & 0 deletions
134
...ixtures/plugins/alerting-dashboards-plugin/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
...fixtures/plugins/alerting-dashboards-plugin/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" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
cypress/fixtures/plugins/alerting-dashboards-plugin/sample_destination_chime.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,7 @@ | ||
{ | ||
"name": "sample_destination_chime", | ||
"type": "chime", | ||
"chime": { | ||
"url": "https://hooks.chime.aws/incomingwebhooks/XXX?token=XXX" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
cypress/fixtures/plugins/alerting-dashboards-plugin/sample_destination_custom_webhook.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,10 @@ | ||
{ | ||
"name": "sample_destination", | ||
"type": "custom_webhook", | ||
"custom_webhook": { | ||
"header_params": { | ||
"Content-Type": "application/json" | ||
}, | ||
"url": "http://www.sampledestination.com" | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
...ures/plugins/alerting-dashboards-plugin/sample_extraction_query_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,63 @@ | ||
{ | ||
"name": "sample_extraction_query_bucket_level_monitor", | ||
"monitor_type": "bucket_level_monitor", | ||
"enabled": true, | ||
"schedule": { | ||
"period": { | ||
"interval": 1, | ||
"unit": "MINUTES" | ||
} | ||
}, | ||
"inputs": [ | ||
{ | ||
"search": { | ||
"indices": ["*"], | ||
"query": { | ||
"size": 0, | ||
"query": { | ||
"bool": { | ||
"filter": [ | ||
{ | ||
"range": { | ||
"order_date": { | ||
"from": "{{period_end}}||-1h", | ||
"to": "{{period_end}}", | ||
"include_lower": true, | ||
"include_upper": true, | ||
"format": "epoch_millis", | ||
"boost": 1.0 | ||
} | ||
} | ||
} | ||
], | ||
"adjust_pure_negative": true, | ||
"boost": 1.0 | ||
} | ||
}, | ||
"aggregations": { | ||
"composite_agg": { | ||
"composite": { | ||
"size": 10, | ||
"sources": [ | ||
{ | ||
"user": { | ||
"terms": { | ||
"field": "user", | ||
"missing_bucket": false, | ||
"order": "asc" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"triggers": [], | ||
"ui_metadata": { | ||
"schedule": {} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between ENDPOINT_WITH_PROXY and MANAGED_SERVICE_ENDPOINT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for the
MANAGED_SERVICE_ENDPOINT
flag we are trying to separate the tests that are only applicable to managed service side domain. In this case the Amazon SNS type destination is only on AWS Opensearch so it will fail on an open source domain. I believe there are cases when the domain is on managed service side and is not proxy enabled, so it could be 2 different flags.I will add the description of this flag to the documentation too.