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

[Metrics UI] Increase metric threshold test coverage #111798

Closed
neptunian opened this issue Sep 9, 2021 · 9 comments
Closed

[Metrics UI] Increase metric threshold test coverage #111798

neptunian opened this issue Sep 9, 2021 · 9 comments
Labels
Feature:Metrics UI Metrics UI feature info-needed Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge"

Comments

@neptunian
Copy link
Contributor

neptunian commented Sep 9, 2021

We need to improve test coverage around the Metric Threshold rule and alerting. Here is our current state and an incomplete list of some scenarios we are missing.

  • Unit tests

  • Integration tests

    • metric_threshold_alert.ts . Using archive data to test whether an alert should fire. We should add more scenarios and edge cases that are possible to create
    • metrics_alerting.ts. This file currently only contains tests that test the result of the elasticsearch query we use for the alert. I think it'd be useful to add more scenarios here in case an alert is firing for a different reason we might assume it is in metric_threshold_alert.ts and so we understand why its firing or not in more complex scenarios. We could possibly combine these two files to keep the scenarios in one test.

Improvements (feel free to edit):

  • Unit tests to add
    • evaluate_alert.ts. There are several functions in here where we should add unit tests for
  • Integration tests to add
    • "Alert me if there's no data" is checked in combination with other scenarios such as querying for when document count is <= 0
    • groupBy is used with or without "Alert me if there's no data" and document count is <= 0
    • multiple conditions
    • adding various warning thresholds
    • KQL filter query in combination with other scenarios
    • various time units
    • various comparators
    • various aggregators
@neptunian neptunian added the Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services label Sep 9, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@Zacqary
Copy link
Contributor

Zacqary commented Sep 9, 2021

  • "Alert me if there's no data" is checked in combination with other scenarios such as querying for when document count is <= 0
  • groupBy is used with or without "Alert me if there's no data" and document count is <= 0

#111465 adds at least some of these, testing specifically with a groupBy enabled. We can expand that for sure.

@miltonhultgren miltonhultgren added Feature:Metrics UI Metrics UI feature Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" labels Jun 23, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-observability (Team: Actionable Observability)

@miltonhultgren miltonhultgren removed the Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services label Jun 23, 2023
@roshan-elastic
Copy link

Hey @neptunian / @katrin-freihofner - do you think this work makes sense anymore if we move to a single 'threshold' type rule (as I believe is planned)?

Checking this work would still be valuable if we do.

@katrin-freihofner
Copy link
Contributor

Yes, we are working on end-to-end testing.

@roshan-elastic
Copy link

Thanks @katrin-freihofner.

@neptunian / @smith - Shall we wait until the new threshold types are done before we tackle this?

@maryam-saeidi
Copy link
Member

@roshan-elastic We are working on a new rule to replace metric threshold, inventory and log threshold. So I am not even sure if it makes sense to put the effort into increasing the test coverage.

Also, I added an integration test for metric threshold in this PR, so we already improved the coverage.

My suggestion is to close this ticket in favor of the new rule. We already have a test plan for the new rule.

@roshan-elastic
Copy link

Thanks a lot @maryam-saeidi - that's really helpful.

@neptunian - I'll let you decide on whether we close this or not.

@neptunian
Copy link
Contributor Author

I created this when we owned the rule but now it makes sense for AO to handle it as @maryam-saeidi describes. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Metrics UI Metrics UI feature info-needed Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge"
Projects
None yet
Development

No branches or pull requests

7 participants