-
Notifications
You must be signed in to change notification settings - Fork 80
Add User to Alerts, add filterby backendroles #264
Conversation
…tination response, 3/ handle null in GetMonitorRequest
Codecov Report
@@ Coverage Diff @@
## master #264 +/- ##
=========================================
Coverage ? 80.64%
Complexity ? 199
=========================================
Files ? 150
Lines ? 5099
Branches ? 670
=========================================
Hits ? 4112
Misses ? 627
Partials ? 360
Continue to review full report at Codecov.
|
.../src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/settings/AlertingSettings.kt
Outdated
Show resolved
Hide resolved
.../src/main/resources/com/amazon/opendistroforelasticsearch/alerting/alerts/alert_mapping.json
Show resolved
Hide resolved
alerting/src/test/kotlin/com/amazon/opendistroforelasticsearch/alerting/MonitorRunnerIT.kt
Outdated
Show resolved
Hide resolved
.put(OPENDISTRO_SECURITY_SSL_HTTP_PEMCERT_FILEPATH, "sample.pem") | ||
.put(OPENDISTRO_SECURITY_SSL_HTTP_KEYSTORE_FILEPATH, "test-kirk.jks") | ||
.put(OPENDISTRO_SECURITY_SSL_HTTP_KEYSTORE_PASSWORD, "changeit") | ||
.put(OPENDISTRO_SECURITY_SSL_HTTP_KEYSTORE_KEYPASSWORD, "changeit") |
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.
Out of curiosity, what's the difference between the KEYSTORE_PASSWORD
and KEYSTORE_KEYPASSWORD
?
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.
Minor refactor comments, but they not related to the current PR, so I am fine with that refactor being done in a later PR.
val severityLevel: String | ||
val alertState: String | ||
val monitorId: String? |
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.
Lets remove these attributes since they are used for filtering the query. These query filters can be added to the attribute filter
and we can change filter
to be type: List<TermsQueryBuilder>
destinationId: String?, | ||
version: Long, | ||
srcContext: FetchSourceContext?, | ||
table: Table, | ||
destinationType: String |
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.
Lets remove destinationId
and destinationType
since they are used for filtering the query. These query filters can be added to the attribute filter
and we can change filter
to be type: List<TermsQueryBuilder>
Setting.Property.NodeScope, Setting.Property.Dynamic) | ||
|
||
val FILTER_BY_BACKEND_ROLES = Setting.boolSetting( | ||
"opendistro.alerting.filterby_backendroles", |
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.
Should the actual setting name match the naming change as well?
I.e
opendistro.alerting.filter_by_backend_roles
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.
My bad, fixed.
* add User to Alerts, add filterby bckroles * Added unit tests * rename setting option and reverted one unit test * Fixed a typo
Issue #, if available:
#6
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.