Skip to content

Instantly share code, notes, and snippets.

@anuchandy
Created October 18, 2020 22:56
Show Gist options
  • Save anuchandy/ddfbd04e7daf5c15a787aed82ee7038c to your computer and use it in GitHub Desktop.
Save anuchandy/ddfbd04e7daf5c15a787aed82ee7038c to your computer and use it in GitHub Desktop.

Task_1: metric, anomalies and anomaly detection tuning

concept:

Screen Shot 2020-10-18 at 3 35 39 PM

action:

  1. Get the metric with the name "cost" from the data feed and - print its id.
  2. For the "cost" metric, gets the anomaly detection configuration with the name "Default" - print its name, id, and existing condition applied for the whole time-series.
  3. Count anomalies detected by the "Default" anomaly detection configuration with start time 2020-9-1 & end time 2020-9-30 - print the count.
  4. In this "Default" anomaly detection configuration, set a condition for the whole time-series, which will detect an anomaly if values are outside an upper bound threshold of 1200000, and suppress any anomalies until 100% of the latest two data-points are detected as anomalies. Combine the new condition with the existing condition using an OR operator.

Task_2: feedback

concept:

Screen Shot 2020-10-18 at 3 52 34 PM

action:

For one of the anomalies detected by the "Default" anomaly detection configuration, submit an AnomalyFeedback indicating that it's not an anomaly.

Task_3: anomaly incidents and root causes

concept:

Screen Shot 2020-10-18 at 3 37 09 PM

action:

  1. Retrieve the incidents produced by the "Default" anomaly detection configuration with start time 2020-9-1 & end time 2020-9-30 - print the first Incident.
  2. For the first Incident, query all root causes - print the description of each root cause.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment