-
Notifications
You must be signed in to change notification settings - Fork 80
Adding HTTP Input type for monitors #82
Adding HTTP Input type for monitors #82
Conversation
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.
We also need some limit on response size as over-large responses can take down the cluster.
alerting/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/MonitorRunner.kt
Outdated
Show resolved
Hide resolved
...rc/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/httpapi/HttpExtensions.kt
Outdated
Show resolved
Hide resolved
...ing/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/client/HttpInputClient.kt
Show resolved
Hide resolved
core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/model/HttpInput.kt
Show resolved
Hide resolved
core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/model/HttpInput.kt
Show resolved
Hide resolved
core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/model/HttpInput.kt
Outdated
Show resolved
Hide resolved
core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/model/HttpInput.kt
Show resolved
Hide resolved
core/src/test/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/model/HttpInputTest.kt
Outdated
Show resolved
Hide resolved
Changed to isEmpty()
Fix typo
Also added test.
Multiply by 1000 in toGetRequest function to convert to ms
@vinooamzn There is no out of box function for the client to limit response size. The way I can think of preventing this problem is to restrict the maximum timeout value so that large amount of data cannot be transmitted in limited time. Do you know any good way to limit the content size? |
Revisions on several issues: - Reusing client in `MonitorRunner` - Allowing only port 9200 for localhost in `HttpInput` - Fixed typo in `README.md` - Validation only one of url or scheme+host+port+path+params is set in `HttpInput`. - Set maximum timeout values to 60s and updated tests.
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.
Limiting response size to 100MB in MonitorRunner.collectInputResult()
.
alerting/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/MonitorRunner.kt
Outdated
Show resolved
Hide resolved
alerting/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/MonitorRunner.kt
Outdated
Show resolved
Hide resolved
alerting/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/MonitorRunner.kt
Show resolved
Hide resolved
alerting/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/MonitorRunner.kt
Outdated
Show resolved
Hide resolved
...rc/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/httpapi/HttpExtensions.kt
Outdated
Show resolved
Hide resolved
alerting/src/test/kotlin/com/amazon/opendistroforelasticsearch/alerting/MonitorRunnerIT.kt
Show resolved
Hide resolved
core/src/main/kotlin/com/amazon/opendistroforelasticsearch/alerting/core/model/HttpInput.kt
Outdated
Show resolved
Hide resolved
Move port validation from HttpInput to RestIndexMonitorAction. Validation funtion ensures that the port number for localhost is restricted to the default port specified in settings.
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.
Resolved
* Add http method to custom webhook * Remove unused line * Opendistro 1.3 * Revert "Adding new type of input for Monitors - HttpInput (#82)" This reverts commit c2004f7. * fix alerting stats API (#129) * Bump plugin version (#131) * Restrict custom http alert method to POST PUT and PATCH * Fix indenting * Fix indention * Fix additional indention Co-authored-by: Jason Leezer <[email protected]> Co-authored-by: Lucas Winkelmann <[email protected]> Co-authored-by: Jinsoo <[email protected]> Co-authored-by: Mohammad Qureshi <[email protected]>
* Add http method to custom webhook * Remove unused line * Opendistro 1.3 * Revert "Adding new type of input for Monitors - HttpInput (#82)" This reverts commit c2004f7. * fix alerting stats API (#129) * Bump plugin version (#131) * Restrict custom http alert method to POST PUT and PATCH * Fix indenting * Fix indention * Fix additional indention Co-authored-by: Jason Leezer <[email protected]> Co-authored-by: Lucas Winkelmann <[email protected]> Co-authored-by: Jinsoo <[email protected]> Co-authored-by: Mohammad Qureshi <[email protected]>
*Issue #, if available: #47
*Description of changes:
HttpInput
for monitors.MonitorRunner
class creates aHttpInputClient
when collecting input results of anHttpInput
.README
file regarding settingJAVA_HOME
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.