Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #988 from chaos-genius/develop
Browse files Browse the repository at this point in the history
release: v0.8.0
  • Loading branch information
Samyak2 authored Jun 10, 2022
2 parents ee1f68b + 2e7448e commit b5eadb6
Show file tree
Hide file tree
Showing 61 changed files with 2,299 additions and 1,094 deletions.
18 changes: 11 additions & 7 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ TIMEZONE=UTC
# Synctime for your metadata
METADATA_SYNC_TIME=03:00

### KPI Configuration
# Sets the maximum number of rows allowed for a KPI to be added.
MAX_ROWS_IN_KPI=10000000

### Anomaly Configuration
# Enables the generation of multi-dimensional subgroups.
MULTIDIM_ANALYSIS_FOR_ANOMALY=False
Expand All @@ -32,19 +36,19 @@ MAX_FILTER_SUBGROUPS_ANOMALY=250
# Sets the maximum number of days for which we can have no data and still consider the KPI for Anomaly Detection.
MAX_ANOMALY_SLACK_DAYS=14

### DeepDrills Configuration
# Sets the maximum number of rows allowed for a KPI to be added.
MAX_ROWS_FOR_DEEPDRILLS=10000000
# Sets the maximum number of days for which we can have no data and still consider the KPI for DeepDrills.
MAX_DEEPDRILLS_SLACK_DAYS=14
### Summary and DeepDrills Configuration
# Sets the maximum number of days for which we can have no data and still consider the KPI for Summary and DeepDrills.
MAX_SUMMARY_DEEPDRILLS_SLACK_DAYS=14
# Sets the enabled time ranges for which Summary and DeepDrills is computed as comma separated values.
SUMMARY_DEEPDRILLS_ENABLED_TIME_RANGES=last_30_days,last_7_days,previous_day,month_on_month,month_to_date,week_on_week,week_to_date
# Enables or disables DeepDrills.
DEEPDRILLS_ENABLED=False
# Sets the maximum number of rows in the first level of the DeepDrills' drilldowns.
DEEPDRILLS_HTABLE_MAX_PARENTS=5
# Sets the maximum number of rows in the subsequent levels of the DeepDrills' drilldowns.
DEEPDRILLS_HTABLE_MAX_CHILDREN=5
# Sets the maximum depth of the drilldowns in DeepDrills.
DEEPDRILLS_HTABLE_MAX_DEPTH=3
# Sets the enabled time ranges for which DeepDrills is computed as comma separated values.
DEEPDRILLS_ENABLED_TIME_RANGES=last_30_days,last_7_days,previous_day,month_on_month,month_to_date,week_on_week,week_to_date

## Sentry Logging (leave empty to disable backend telemetry)
SENTRY_DSN=
Expand Down
7 changes: 4 additions & 3 deletions .env.local.template
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ MAX_SUBDIM_CARDINALITY=1000
TOP_DIMENSIONS_FOR_ANOMALY_DRILLDOWN=10
MIN_DATA_IN_SUBGROUP=30
TOP_SUBDIMENSIONS_FOR_ANOMALY=10
MAX_ROWS_FOR_DEEPDRILLS=10000000
MAX_ROWS_IN_KPI=10000000
MAX_FILTER_SUBGROUPS_ANOMALY=250
MAX_DEEPDRILLS_SLACK_DAYS=14
MAX_SUMMARY_DEEPDRILLS_SLACK_DAYS=14
MAX_ANOMALY_SLACK_DAYS=14
DAYS_OFFSET_FOR_ANALTYICS=2

SUMMARY_DEEPDRILLS_ENABLED_TIME_RANGES=last_30_days,last_7_days,previous_day
DEEPDRILLS_ENABLED=False
DEEPDRILLS_HTABLE_MAX_PARENTS=5
DEEPDRILLS_HTABLE_MAX_CHILDREN=5
DEEPDRILLS_HTABLE_MAX_DEPTH=3
DEEPDRILLS_ENABLED_TIME_RANGES=last_30_days,last_7_days,previous_day
7 changes: 5 additions & 2 deletions chaos_genius/alerts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
VS Code extension (or the Pyright equivalent in other editors) along with flake8 when
developing.
"""
import datetime
import logging
from typing import List, Optional, Tuple

Expand All @@ -17,7 +18,9 @@
logger = logging.getLogger()


def check_and_trigger_alert(alert_id: int):
def check_and_trigger_alert(
alert_id: int, last_anomaly_timestamp: Optional[datetime.datetime] = None
):
"""Check the alert and trigger the notification if found.
Args:
Expand Down Expand Up @@ -50,7 +53,7 @@ def check_and_trigger_alert(alert_id: int):
elif (
alert_info.alert_type == "KPI Alert" and alert_info.kpi_alert_type == "Anomaly"
):
anomaly_obj = AnomalyAlertController(alert_info)
anomaly_obj = AnomalyAlertController(alert_info, last_anomaly_timestamp)
return anomaly_obj.check_and_send_alert()
elif alert_info.alert_type == "KPI Alert" and alert_info.kpi_alert_type == "Static":
# TODO: is this still needed?
Expand Down
Loading

0 comments on commit b5eadb6

Please sign in to comment.