File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ ignore_missing_imports = true
44
55[tool .poetry ]
66name = " pyth-observer"
7- version = " 0.1.6 "
7+ version = " 0.1.7 "
88description = " Alerts and stuff"
99authors = []
1010readme = " README.md"
Original file line number Diff line number Diff line change 1111from loguru import logger
1212
1313from pyth_observer .check import Check
14+ from pyth_observer .check .publisher import PublisherCheck
1415
1516
1617class Context (TypedDict ):
@@ -35,8 +36,17 @@ async def send(self):
3536 # Publisher checks expect the key -> name mapping of publishers when
3637 # generating the error title/message.
3738 text = self .check .error_message ()
39+
40+ # An example is: PriceFeedOfflineCheck-Crypto.AAVE/USD
41+ aggregation_key = f"{ self .check .__class__ .__name__ } -{ self .check .state ().symbol } "
42+
43+ if self .check .__class__ .__bases__ == (PublisherCheck ,):
44+ # Add publisher key to the aggregation key to separate different faulty publishers
45+ # An example would be: PublisherPriceCheck-Crypto.AAVE/USD-9TvAYCUkGajRXs....
46+ aggregation_key += "-" + self .check .state ().public_key
47+
3848 event = DatadogAPIEvent (
39- aggregation_key = f" { self . check . __class__ . __name__ } - { self . check . state (). symbol } " ,
49+ aggregation_key = aggregation_key ,
4050 title = text .split ("\n " )[0 ],
4151 text = text ,
4252 tags = [
You can’t perform that action at this time.
0 commit comments