-
Notifications
You must be signed in to change notification settings - Fork 102
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
initial commit for remote monitor support #1547
Merged
Merged
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
197b7f8
initial commit for remote monitor support
sbcd90 0181b85
changes to add support for remote monitors in alerting
sbcd90 70f165f
changes to cleanup the pr
sbcd90 8bd00b4
fix ktlint for windows
sbcd90 a840958
update alerting with latest common-utils commit
sbcd90 315d8ac
update test-workflow
sbcd90 629a0c3
changes to support generic inputs and triggers in remote monitors
sbcd90 f48253c
attempt to fix windows builds
sbcd90 77a83ff
fix windows builds
sbcd90 4b88443
Merge branch 'main' into remote_monitor
sbcd90 ae13a15
fix merge conflicts
sbcd90 5564e3a
fix ktlint issues
sbcd90 58a6f29
fix windows build
sbcd90 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
55 changes: 55 additions & 0 deletions
55
...lugin/src/main/java/org/opensearch/alerting/monitor/inputs/SampleRemoteMonitorInput1.java
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,55 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.alerting.monitor.inputs; | ||
|
||
import org.opensearch.core.common.io.stream.StreamInput; | ||
import org.opensearch.core.common.io.stream.StreamOutput; | ||
import org.opensearch.core.common.io.stream.Writeable; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
public class SampleRemoteMonitorInput1 implements Writeable { | ||
|
||
private String a; | ||
|
||
private Map<String, Object> b; | ||
|
||
private int c; | ||
|
||
public SampleRemoteMonitorInput1(String a, Map<String, Object> b, int c) { | ||
this.a = a; | ||
this.b = b; | ||
this.c = c; | ||
} | ||
|
||
public SampleRemoteMonitorInput1(StreamInput sin) throws IOException { | ||
this( | ||
sin.readString(), | ||
sin.readMap(), | ||
sin.readInt() | ||
); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeString(a); | ||
out.writeMap(b); | ||
out.writeInt(c); | ||
} | ||
|
||
public int getC() { | ||
return c; | ||
} | ||
|
||
public Map<String, Object> getB() { | ||
return b; | ||
} | ||
|
||
public String getA() { | ||
return a; | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
...lugin/src/main/java/org/opensearch/alerting/monitor/inputs/SampleRemoteMonitorInput2.java
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,46 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.alerting.monitor.inputs; | ||
|
||
import org.opensearch.commons.alerting.model.DocLevelMonitorInput; | ||
import org.opensearch.core.common.io.stream.StreamInput; | ||
import org.opensearch.core.common.io.stream.StreamOutput; | ||
import org.opensearch.core.common.io.stream.Writeable; | ||
|
||
import java.io.IOException; | ||
|
||
public class SampleRemoteMonitorInput2 implements Writeable { | ||
|
||
private String a; | ||
|
||
private DocLevelMonitorInput b; | ||
|
||
public SampleRemoteMonitorInput2(String a, DocLevelMonitorInput b) { | ||
this.a = a; | ||
this.b = b; | ||
} | ||
|
||
public SampleRemoteMonitorInput2(StreamInput sin) throws IOException { | ||
this( | ||
sin.readString(), | ||
DocLevelMonitorInput.readFrom(sin) | ||
); | ||
} | ||
|
||
@Override | ||
public void writeTo(StreamOutput out) throws IOException { | ||
out.writeString(a); | ||
b.writeTo(out); | ||
} | ||
|
||
public String getA() { | ||
return a; | ||
} | ||
|
||
public DocLevelMonitorInput getB() { | ||
return b; | ||
} | ||
} |
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
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
Oops, something went wrong.
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.
do we also need RemoteMonitorInput xcontent registry?
if yes, can you add appropriate tests to serialize
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 dont need
RemoteMonitorInput
because incommon-utils
Input.parse
doesn't use it. https://github.com/opensearch-project/common-utils/blob/main/src/main/kotlin/org/opensearch/commons/alerting/model/Input.kt#L30however, in
Trigger.parse
it is used. https://github.com/opensearch-project/common-utils/blob/main/src/main/kotlin/org/opensearch/commons/alerting/model/Trigger.kt#L41