-
Notifications
You must be signed in to change notification settings - Fork 112
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 integration of TelemetryAwarePlugin with Rollover Step Integration #1186
Initial integration of TelemetryAwarePlugin with Rollover Step Integration #1186
Conversation
Signed-off-by: harycash <harycash@amazon.com>
import org.opensearch.indexmanagement.indexstatemanagement.ManagedIndexRunner | ||
import org.opensearch.indexmanagement.indexstatemanagement.PluginVersionSweepCoordinator | ||
import org.opensearch.indexmanagement.indexstatemanagement.SkipExecution | ||
import org.opensearch.indexmanagement.indexstatemanagement.* |
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.
please do not use wildcard
import org.opensearch.plugins.NetworkPlugin | ||
import org.opensearch.plugins.Plugin | ||
import org.opensearch.plugins.SystemIndexPlugin | ||
import org.opensearch.plugins.* |
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.
same, please remove wildcard
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.
Yes, I've made the updates in the new commit.
fun initialize(metricsRegistry: MetricsRegistry) { | ||
this.metricsRegistry = metricsRegistry | ||
actionMetricsMap = mapOf( | ||
"rollover" to RolloverActionMetrics(metricsRegistry), |
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.
this is not defined yet, please remove this for now. We can populate the map in the subsequent PR
Signed-off-by: harycash <harycash@amazon.com>
@harshitakaushik-dev thanks for iteration, would you please add some UTs to verify the behavior in the next iteration. Also, please check some lint related gradle tasks seem to be failing. |
… Integration Signed-off-by: harycash <harycash@amazon.com>
@bowenlan-amzn @Gaganjuneja it would be great if you guys can take a look! The file diff id huge, but its mostly change in arguments of a function. The change for one action would somewhat look like this commit |
… Integration Signed-off-by: harycash <harycash@amazon.com>
@sarthakaggarwal97 commented on Jun 12, 2024, 10:23 PM PDT:
Really like this change, with metrics, user can setup alarm instead of only relying on the error notifications, which is a long-asking feature. |
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.
Thanks for PR @harshitakaushik-dev! Commenting from a quick look and it's a good start. Can you please look into the check failures and fix the cause. I'm interested in reviewing in depth later. Thanks!
...opensearch.indexmanagement.spi/indexstatemanagement/metrics/IndexManagementActionsMetrics.kt
Show resolved
Hide resolved
...opensearch.indexmanagement.spi/indexstatemanagement/metrics/IndexManagementActionsMetrics.kt
Show resolved
Hide resolved
...opensearch.indexmanagement.spi/indexstatemanagement/metrics/IndexManagementActionsMetrics.kt
Show resolved
Hide resolved
val context = this.context ?: return this | ||
val indexName = context.metadata.index | ||
val clusterService = context.clusterService | ||
val skipRollover = clusterService.state().metadata.index(indexName).getRolloverSkip() | ||
this.indexManagementActionsMetrics = indexManagementActionsMetrics |
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 use it after assignment? What's the need here?
val context = this.context ?: return this | ||
val indexName = context.metadata.index | ||
val clusterService = context.clusterService | ||
val skipRollover = clusterService.state().metadata.index(indexName).getRolloverSkip() | ||
this.indexManagementActionsMetrics = indexManagementActionsMetrics | ||
this.actionMetrics = indexManagementActionsMetrics.getActionMetrics("rollover") as RolloverActionMetrics |
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.
Use "rollover" as const.
Tags.create().addTag("index_name", context.metadata.index) | ||
.addTag("policy_id", context.metadata.policyID).addTag("node_id", context.clusterService.nodeName), | ||
) |
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 this be encapsulated inside of RolloverActionMetrics
/ActionMetrics
itself?
|
||
@Suppress("ComplexMethod", "LongMethod") | ||
override suspend fun execute(): Step { | ||
override suspend fun execute(indexManagementActionsMetrics: IndexManagementActionsMetrics): Step { |
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.
Corresponding param in super class (Step) doesn't match the param name here. It will result in compilation failures.
Description of changes:
CheckList:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.