Skip to content
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

Implemented cross-cluster monitor support #584

Merged
merged 4 commits into from
Feb 6, 2024

Conversation

AWSHurneyt
Copy link
Collaborator

@AWSHurneyt AWSHurneyt commented Feb 5, 2024

Description

Added clusters field to support cross-cluster cluster metrics monitors.

Documentation PR for reference opensearch-project/documentation-website#6350

Issues Resolved

opensearch-project/alerting-dashboards-plugin#796

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

@@ -43,6 +43,7 @@ data class Alert(
val aggregationResultBucket: AggregationResultBucket? = null,
val executionId: String? = null,
val associatedAlertIds: List<String>,
val clusters: List<String>? = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this break security analytics constructor?? if yes, plz create PR for that too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is stored here? can you share an example list of opensource clusters?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be called clusterNames or clusterIds

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created this PR to update SAP opensearch-project/security-analytics#837

@@ -43,6 +43,7 @@ data class Alert(
val aggregationResultBucket: AggregationResultBucket? = null,
val executionId: String? = null,
val associatedAlertIds: List<String>,
val clusters: List<String>? = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plz udpate the alert parsing unit tests to account for this field

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revised.

@@ -43,6 +43,7 @@ data class Alert(
val aggregationResultBucket: AggregationResultBucket? = null,
val executionId: String? = null,
val associatedAlertIds: List<String>,
val clusters: List<String>? = null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be called clusterNames or clusterIds

@@ -74,6 +75,7 @@ data class ClusterMetricsInput(
.field(PATH_FIELD, path)
.field(PATH_PARAMS_FIELD, pathParams)
.field(URL_FIELD, url)
.field(CLUSTERS_FIELD, clusters)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same.. update parsing tests for clusterMetricsInput model or plz add a test if non-existent

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revised.

Signed-off-by: AWSHurneyt <[email protected]>
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (a632b47) 74.25% compared to head (f21af4e) 74.13%.

Files Patch % Lines
...lin/org/opensearch/commons/alerting/model/Alert.kt 70.96% 7 Missing and 2 partials ⚠️
...arch/commons/alerting/model/ClusterMetricsInput.kt 25.00% 9 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #584      +/-   ##
============================================
- Coverage     74.25%   74.13%   -0.13%     
- Complexity      884      890       +6     
============================================
  Files           133      133              
  Lines          5791     5822      +31     
  Branches        708      714       +6     
============================================
+ Hits           4300     4316      +16     
- Misses         1181     1194      +13     
- Partials        310      312       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sbcd90 sbcd90 merged commit 0c23cc5 into opensearch-project:main Feb 6, 2024
10 of 11 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/common-utils/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/common-utils/backport-2.x
# Create a new branch
git switch --create backport-584-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0c23cc5b594be2d057d3e0e079596686ef703a80
# Push it to GitHub
git push --set-upstream origin backport-584-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/common-utils/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport-584-to-2.x.

AWSHurneyt added a commit that referenced this pull request Feb 6, 2024
* Added clusters field to support cross cluster cluster metrics monitors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed writeTo.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated tests.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated tests.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
@AWSHurneyt AWSHurneyt deleted the 3.0-cross-cluster-dev branch February 7, 2024 18:26
AWSHurneyt added a commit to AWSHurneyt/common-utils that referenced this pull request Apr 12, 2024
…roject#584 (opensearch-project#586)

* Added clusters field to support cross cluster cluster metrics monitors.

Signed-off-by: AWSHurneyt <[email protected]>

* Fixed writeTo.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated tests.

Signed-off-by: AWSHurneyt <[email protected]>

* Updated tests.

Signed-off-by: AWSHurneyt <[email protected]>

---------

Signed-off-by: AWSHurneyt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants