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.

Signed-off-by: gaobinlong <gbinlong@amazon.com>
@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.

Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
Signed-off-by: gaobinlong <gbinlong@amazon.com>
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 <gbinlong@amazon.com>

* Check feature flag before registering action to Discover page

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix url bug

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Remove unused dependency

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix e2e test failure

Signed-off-by: gaobinlong <gbinlong@amazon.com>

---------

Signed-off-by: gaobinlong <gbinlong@amazon.com>
(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 <gbinlong@amazon.com>

* Check feature flag before registering action to Discover page

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix url bug

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Remove unused dependency

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix e2e test failure

Signed-off-by: gaobinlong <gbinlong@amazon.com>

---------

Signed-off-by: gaobinlong <gbinlong@amazon.com>
(cherry picked from commit 26b12d1)

Co-authored-by: gaobinlong <gbinlong@amazon.com>
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