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

Add metrics correlation algorithm #3877

Merged
merged 9 commits into from
Apr 27, 2023
Merged

Add metrics correlation algorithm #3877

merged 9 commits into from
Apr 27, 2023

Conversation

Naarcha-AWS
Copy link
Collaborator

Fixes #3815

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>
| Parameter | Type | Description | Default Value |
|---|---|---|---|
metrics | Integer | A list of metrics within the time series that can be correlated to anomalous behavior | N/A
Copy link
Contributor

Choose a reason for hiding this comment

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

input is a list of metrics. Every metrics is an array of numbers/float values.

A simplest example can be: {"metrics": [[1.0, 2.0, 3.0], [1.0, 2.0, 3.0]]}, here 2 metrics are provided and each metrics has 3 datapoints.

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved

1. For each metric, the input sequence has same T length.
2. Before inputting, all input metrics should have the same corresponding set of timestamps.

Choose a reason for hiding this comment

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

"Before inputting" doesn't seem necessary here

{: .warning }

The metrics correlation algorithm finds events in a set of metrics data. The algorithm defines events as a window in time where multiple metrics simultaneously display anomalous behavior. When given a time span and set of metrics, The algorithm correlates the number of events that occurred, when the event occurred, and determines which metrics were involved in each event.

Choose a reason for hiding this comment

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

Two minor notes here:

  1. The algorithm is not given a time span, just a set of metrics.
  2. "The algorithm correlates the number of events that occurred" is a little awkward. I would suggest "The algorithm automatically determines the number of events that occurred, when each event occurred, ..."

**Response**

In the following example response, each item corresponds to an event discovered in the metrics data. The API returns the following information:

Choose a reason for hiding this comment

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

Should we add a line about the interpretation of this output? Basically:

  1. The metrics correlation algorithm finds one event in this input data (indicated by the output list having length 1).
  2. The event occurred between time points $t=52$ and $t=72$ (indicated by the "event window" field).
  3. The event involved all three metrics (indicated by the "suspected metrics" field).

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
## Metrics correlation

The metrics correlation feature is an experimental feature released in OpenSearch 2.7. It can't be used in a production environment. To leave feedback on improving the feature, leave an issue in the [ML Commons repository](https://github.com/opensearch-project/ml-commons).
Copy link
Contributor

Choose a reason for hiding this comment

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

Overall looks good to me. It can't be used in a production environment. seems bit unnecessary. Generally experimental feature means not ready for prod environment

@Naarcha-AWS Naarcha-AWS added 5 - Final Editorial Review PR: Editorial Review in progress 4 - Doc Review PR: Doc review in progress and removed 3 - Tech Review PR: Tech review in progress 5 - Final Editorial Review PR: Editorial Review in progress labels Apr 26, 2023
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Naarcha-AWS and others added 3 commits April 27, 2023 10:03
Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
@Naarcha-AWS Naarcha-AWS added 5 - Final Editorial Review PR: Editorial Review in progress and removed 4 - Doc Review PR: Doc review in progress labels Apr 27, 2023
Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

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

@Naarcha-AWS Approved with noted comments and changes. Let me know if you have any questions. Thanks!

_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
{: .warning }

The metrics correlation algorithm finds events in a set of metrics data. The algorithm defines events as a window in time where multiple metrics simultaneously display anomalous behavior. When given a set of metrics, the algorithm counts the number of events that occurred, when each event occurred, and determines which metrics were involved in each event.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Global: "metric data" instead of "metrics data"?

_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
_ml-commons-plugin/algorithms.md Outdated Show resolved Hide resolved
- `suspected_metrics`: The set of metrics involved.

In the following example response, each item corresponds to an event discovered in the metrics data. The algorithm finds one event in the input data of the request, as indicated by the output in `event_pattern` having a length of `1`. `event_window` shows that the event occurred between time point $t$ = 52 and $t$ = 72. Lastly, the `suspected_metrics` shows that event involved all three metrics.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add the noun after suspected_metrics. The suspected_metrics what?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Parameter. I removed the "the" here.

@natebower natebower removed the 5 - Final Editorial Review PR: Editorial Review in progress label Apr 27, 2023
Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
@Naarcha-AWS Naarcha-AWS merged commit b5d9cc5 into main Apr 27, 2023
2 checks passed
@Naarcha-AWS Naarcha-AWS deleted the metrics-correlation branch April 27, 2023 17:33
Naarcha-AWS added a commit that referenced this pull request Apr 27, 2023
* Add metrics correlation algorithm

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

---------

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
vagimeli added a commit that referenced this pull request May 4, 2023
* Add metrics correlation algorithm

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

---------

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
vagimeli added a commit that referenced this pull request May 4, 2023
harshavamsi pushed a commit to harshavamsi/documentation-website that referenced this pull request Oct 31, 2023
* Add metrics correlation algorithm

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update algorithms.md

Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Update _ml-commons-plugin/algorithms.md

Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Nathan Bower <nbower@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>

---------

Signed-off-by: Naarcha-AWS <naarcha@amazon.com>
Signed-off-by: Naarcha-AWS <97990722+Naarcha-AWS@users.noreply.github.com>
Co-authored-by: Melissa Vagi <vagimeli@amazon.com>
Co-authored-by: Nathan Bower <nbower@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental release-notes PR: Include this PR in the automated release notes v2.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC][ml-commons] Support Metrics Correlation Algorithm (experimental)
5 participants