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

Report metrics for suggest anomaly detector #876

Merged
merged 5 commits into from
Sep 19, 2024

Conversation

gaobinlong
Copy link
Contributor

@gaobinlong gaobinlong commented Sep 12, 2024

Description

This PR implements a small enhancement for the suggest anomaly detector feature, we add feedback button to the flyout of suggest anomaly detector, when users click the button, it will call the metric report API in the core plugin usageCollection. And when LLM gives suggested parameters successfully, a generated metric is reported, when the suggested detector is created, a created metric is reported.

Another change is that we check the feature flag before register the SuggestAnomalyDetector action to Discover, if the feature flag is disabled or the whole assistant capability is disabled, no action will be registered.

Some UI change:
Features

Add another feature

Issues Resolved

#816

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
  • 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.

@gaobinlong
Copy link
Contributor Author

@jackiehanyang ,please help to review this PR when you're available, thanks, this change doesn't target for 2.17.

if: failure()
with:
name: cypress-screenshots-${{ matrix.os }}
path: opensearch-dashboards-functional-test/cypress/screenshots

- name: Capture failure test video
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update the version to v4 to make sure the e2e test can run normally, if not the test throws deprecation error.

@jackiehanyang
Copy link
Collaborator

jackiehanyang commented Sep 18, 2024

@gaobinlong thanks for the change! Just curious, besides this feedback button, are we collecting usage metrics for this flyout? For example, the number of detectors created via this flyout, or errors that occurred on this flyout. If not, do we have plans to add these business metrics?

@gaobinlong
Copy link
Contributor Author

@gaobinlong thanks for the change! Just curious, besides this feedback button, are we collecting usage metrics for this flyout? For example, the number of detectors created via this flyout, or errors that occurred on this flyout. If not, do we have plans to add these business metrics?

Thanks, except the feedback metrics, we already add generated metric which reports that LLM has given the suggested parameters successfully, and created metric which reports that the suggested detector has been created successfully, but we haven't collect the failures metrics for this flyout, I'll consider this suggestion seriously and implement it later.

reportMetric(SUGGEST_ANOMALY_DETECTOR_METRIC_TYPE.GENERATED);
reportMetric(SUGGEST_ANOMALY_DETECTOR_METRIC_TYPE.CREATED);

@jackiehanyang jackiehanyang merged commit 26b12d1 into opensearch-project:main Sep 19, 2024
9 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 19, 2024
* Add feedback button to the flyout of suggest anomaly detector

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

* Check feature flag before registering action to Discover page

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

* Fix url bug

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

* Remove unused dependency

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

* Fix e2e test failure

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

---------

Signed-off-by: gaobinlong <[email protected]>
(cherry picked from commit 26b12d1)
jackiehanyang pushed a commit that referenced this pull request Sep 19, 2024
* Add feedback button to the flyout of suggest anomaly detector

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

* Check feature flag before registering action to Discover page

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

* Fix url bug

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

* Remove unused dependency

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

* Fix e2e test failure

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

---------

Signed-off-by: gaobinlong <[email protected]>
(cherry picked from commit 26b12d1)

Co-authored-by: gaobinlong <[email protected]>
SuZhou-Joe pushed a commit to SuZhou-Joe/anomaly-detection-dashboards-plugin that referenced this pull request Oct 18, 2024
…pensearch-project#878)

* Add feedback button to the flyout of suggest anomaly detector

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

* Check feature flag before registering action to Discover page

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

* Fix url bug

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

* Remove unused dependency

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

* Fix e2e test failure

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

---------

Signed-off-by: gaobinlong <[email protected]>
(cherry picked from commit 26b12d1)

Co-authored-by: gaobinlong <[email protected]>
jackiehanyang pushed a commit that referenced this pull request Oct 18, 2024
* Add suggest anomaly detector action to discover page (#849) (#872)

* Add generate anomaly detector action to discover page

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

* Add more test code and rename the file

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

* Modify flyout header

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

* Make the detectorName follow the convention

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

* Truncate the index pattern name if it's too long

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

* Move entry point to query editor

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

* Call the node API in dashboard-assistant plugin to generate parameters

Refactor unit test code

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

* Fix test failure

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

* Revert the code format

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

* Remove some empty lines

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

---------

Signed-off-by: gaobinlong <[email protected]>
(cherry picked from commit ec02b63)

Co-authored-by: gaobinlong <[email protected]>

* Report metrics for suggest anomaly detector (#876) (#878)

* Add feedback button to the flyout of suggest anomaly detector

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

* Check feature flag before registering action to Discover page

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

* Fix url bug

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

* Remove unused dependency

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

* Fix e2e test failure

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

---------

Signed-off-by: gaobinlong <[email protected]>
(cherry picked from commit 26b12d1)

Co-authored-by: gaobinlong <[email protected]>

* feat: update category (#883) (#884)

(cherry picked from commit 9402888)

Co-authored-by: SuZhou-Joe <[email protected]>

* Revert "Increment version to 2.17.1.0 (#881)"

This reverts commit 33dfe2f.

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: gaobinlong <[email protected]>
Co-authored-by: Zhou Su <>
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.

2 participants