Skip to content

Commit

Permalink
changes to add support for remote monitors in alerting
Browse files Browse the repository at this point in the history
Signed-off-by: Subhobrata Dey <[email protected]>
  • Loading branch information
sbcd90 committed May 22, 2024
1 parent 197b7f8 commit 8317f29
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import org.opensearch.core.xcontent.XContentParser
import org.opensearch.core.xcontent.XContentParserUtils
import org.opensearch.index.seqno.SequenceNumbers
import org.opensearch.transport.RemoteTransportException
import java.util.*
import java.util.Locale

private val log = LogManager.getLogger(MonitorMetadataService::class.java)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import org.opensearch.commons.alerting.model.Monitor
import org.opensearch.commons.alerting.model.QueryLevelTrigger
import org.opensearch.transport.TransportService
import java.time.Instant
import java.util.*
import java.util.Locale

object QueryLevelMonitorRunner : MonitorRunner() {
private val logger = LogManager.getLogger(javaClass)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import org.opensearch.core.xcontent.NamedXContentRegistry
import org.opensearch.tasks.Task
import org.opensearch.transport.TransportService
import java.time.Instant
import java.util.*
import java.util.Locale

private val log = LogManager.getLogger(TransportExecuteMonitorAction::class.java)
private val scope: CoroutineScope = CoroutineScope(Dispatchers.IO)
Expand Down
22 changes: 3 additions & 19 deletions sample-remote-monitor-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ integTest {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=8000'
}
}
//project.getTasks().getByName('bundlePlugin').dependsOn(rootProject.project(":alerting").tasks.getByName('build'))
project.getTasks().getByName('bundlePlugin').dependsOn(rootProject.project(":alerting").tasks.getByName('build'))
Zip bundle = (Zip) project.getTasks().getByName("bundlePlugin");
//Zip rootBundle = (Zip) rootProject.project(":alerting").getTasks().getByName("bundlePlugin");
Zip rootBundle = (Zip) rootProject.project(":alerting").getTasks().getByName("bundlePlugin");
integTest.dependsOn(bundle)
integTest.getClusters().forEach{c -> {
// c.plugin(rootProject.project(":alerting").getObjects().fileProperty().value(rootBundle.getArchiveFile()))
c.plugin(rootProject.project(":alerting").getObjects().fileProperty().value(rootBundle.getArchiveFile()))
c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile()))
}}

Expand All @@ -132,22 +132,6 @@ testClusters.integTest {
}
}
setting 'path.repo', repo.absolutePath
plugin(provider({
new RegularFile() {
@Override
File getAsFile() {
return configurations.zipArchive.asFileTree.matching {
include '**/alerting*'
}.singleFile
}
}
}))
nodes.each { node ->
def plugins = node.plugins
def firstPlugin = plugins.get(0)
plugins.remove(0)
plugins.add(firstPlugin)
}
}

run {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ project(":spi").name = 'alerting-spi'

include 'sample-remote-monitor-plugin'
project(":sample-remote-monitor-plugin").name = "alerting-sample-remote-monitor-plugin"
startParameter.excludedTaskNames=["publishPluginZipPublicationToMavenLocal", "publishPluginZipPublicationToStagingRepository"]
startParameter.excludedTaskNames=["publishPluginZipPublicationToMavenLocal", "publishPluginZipPublicationToZipStagingRepository"]

0 comments on commit 8317f29

Please sign in to comment.