Skip to content

Commit

Permalink
Add const for default group alerts threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaKerman committed Oct 14, 2024
1 parent 161330d commit 5f1d7a7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion elementary/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Config:

DEFAULT_TARGET_PATH = os.getcwd() + "/edr_target"

DEFAULT_GROUP_ALERTS_THRESHOLD = 100

def __init__(
self,
config_dir: str = DEFAULT_CONFIG_DIR,
Expand Down Expand Up @@ -128,7 +130,7 @@ def __init__(
self.group_alerts_threshold = self._first_not_none(
group_alerts_threshold,
slack_config.get("group_alerts_threshold"),
100,
self.DEFAULT_GROUP_ALERTS_THRESHOLD,
)

teams_config = config.get(self._TEAMS, {})
Expand Down
2 changes: 1 addition & 1 deletion elementary/monitor/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def get_cli_properties() -> dict:
@click.option(
"--group-alerts-threshold",
type=int,
default=100,
default=Config.DEFAULT_GROUP_ALERTS_THRESHOLD,
help="The threshold for all alerts in a single message.",
)
@click.option(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from elementary.monitor.alerts.grouped_alerts import GroupedByTableAlerts
from elementary.monitor.alerts.alerts_groups import GroupedByTableAlerts
from elementary.monitor.alerts.model_alert import ModelAlertModel
from elementary.monitor.alerts.source_freshness_alert import SourceFreshnessAlertModel
from elementary.monitor.alerts.test_alert import TestAlertModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Union

from elementary.monitor.alerts.grouped_alerts import GroupedByTableAlerts
from elementary.monitor.alerts.grouped_alerts.grouped_alert import AlertsGroup
from elementary.monitor.alerts.alerts_groups import AlertsGroup, GroupedByTableAlerts
from elementary.monitor.alerts.model_alert import ModelAlertModel
from elementary.monitor.alerts.source_freshness_alert import SourceFreshnessAlertModel
from elementary.monitor.alerts.test_alert import TestAlertModel
Expand Down

0 comments on commit 5f1d7a7

Please sign in to comment.