Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f41c1d1
Add test alert message generation for dbt test alerts
MikaKerman Feb 3, 2025
5addebe
Add alert message generation for Elementary test alerts
MikaKerman Feb 3, 2025
d7f3ba8
Add snapshot alert message generation
MikaKerman Feb 3, 2025
bb01970
Add model alert message generation
MikaKerman Feb 3, 2025
bda25c0
Add source freshness alert message generation
MikaKerman Feb 3, 2025
880c61b
Add alerts group message generation
MikaKerman Feb 3, 2025
e1dceae
Enhance GroupedByTableAlerts with robust handling of multi-alert scen…
MikaKerman Feb 3, 2025
eb8666c
Add group by table alert message generation
MikaKerman Feb 3, 2025
66db6ec
Updated `get_details_blocks()` to always include tags, owners, and su…
MikaKerman Feb 4, 2025
a37d0a2
Added a divider block after the subtitle in the source freshness aler…
MikaKerman Feb 4, 2025
8843e5a
Refactor `get_display_name()` to handle optional status - Modified fu…
MikaKerman Feb 4, 2025
4a2eba9
Optimize `get_details_blocks()` with sorted unique lists
MikaKerman Feb 4, 2025
221d8a3
Refactor alert message generation with a unified builder approach
MikaKerman Feb 4, 2025
ba19e7c
Add primary and non-primary fact block builders
MikaKerman Feb 4, 2025
ac35db0
Improve alerts group message block generation with consistent divider…
MikaKerman Feb 5, 2025
eeb0459
Refactor test alert message generation to remove itertools and hardco…
MikaKerman Feb 5, 2025
e0d1351
Add default environment constant and environment specification method
MikaKerman Feb 5, 2025
912f98c
Add environment parameter to alert models and data schemas
MikaKerman Feb 5, 2025
d3178f3
Add environment parameter to alerts groups
MikaKerman Feb 5, 2025
90f79ad
Update alert message tests to support environment parameter
MikaKerman Feb 5, 2025
d0757f4
Consolidate alert subtitle block generation with unified method
MikaKerman Feb 5, 2025
b15157d
Fix full refresh condition in alert message builder
MikaKerman Feb 6, 2025
1386490
Enhance JSON assertion error message in test utility
MikaKerman Feb 6, 2025
41531ae
Add timezone support to alert message test datetime parameters
MikaKerman Feb 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion elementary/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
from elementary.monitor.alerts.grouping_type import GroupingType
from elementary.utils.ordered_yaml import OrderedYaml

DEFAULT_ENV = "dev"


class Config:
_SLACK = "slack"
Expand Down Expand Up @@ -68,7 +70,7 @@ def __init__(
azure_container_name: Optional[str] = None,
report_url: Optional[str] = None,
teams_webhook: Optional[str] = None,
env: str = "dev",
env: str = DEFAULT_ENV,
run_dbt_deps_if_needed: Optional[bool] = None,
project_name: Optional[str] = None,
):
Expand Down Expand Up @@ -249,6 +251,10 @@ def has_gcloud(self):
def has_gcs(self):
return self.gcs_bucket_name and self.has_gcloud

@property
def specified_env(self) -> Optional[str]:
return self.env if self.env != DEFAULT_ENV else None

def validate_monitor(self):
provided_integrations = list(
filter(
Expand Down
18 changes: 18 additions & 0 deletions elementary/messages/block_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ def SummaryLineBlock(
return LineBlock(inlines=text_blocks)


def NonPrimaryFactBlock(fact: Tuple[LineBlock, LineBlock]) -> FactBlock:
title, value = fact
return FactBlock(
title=title,
value=value,
primary=False,
)


def PrimaryFactBlock(fact: Tuple[LineBlock, LineBlock]) -> FactBlock:
title, value = fact
return FactBlock(
title=title,
value=value,
primary=True,
)


def FactsBlock(
*,
facts: Sequence[
Expand Down
2 changes: 2 additions & 0 deletions elementary/monitor/alerts/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def __init__(
report_url: Optional[str] = None,
alert_fields: Optional[List[str]] = None,
elementary_database_and_schema: Optional[str] = None,
env: Optional[str] = None,
**kwargs,
):
self.id = id
Expand Down Expand Up @@ -63,6 +64,7 @@ def __init__(
self.report_url = report_url
self.alert_fields = alert_fields
self.elementary_database_and_schema = elementary_database_and_schema
self.env = env

@property
def unified_meta(self) -> Dict:
Expand Down
Empty file.
Loading
Loading