File tree 2 files changed +12
-2
lines changed
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
4
4
5
5
[tool .poetry ]
6
6
name = " pyth-observer"
7
- version = " 0.1.6 "
7
+ version = " 0.1.7 "
8
8
description = " Alerts and stuff"
9
9
authors = []
10
10
readme = " README.md"
Original file line number Diff line number Diff line change 11
11
from loguru import logger
12
12
13
13
from pyth_observer .check import Check
14
+ from pyth_observer .check .publisher import PublisherCheck
14
15
15
16
16
17
class Context (TypedDict ):
@@ -35,8 +36,17 @@ async def send(self):
35
36
# Publisher checks expect the key -> name mapping of publishers when
36
37
# generating the error title/message.
37
38
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
+
38
48
event = DatadogAPIEvent (
39
- aggregation_key = f" { self . check . __class__ . __name__ } - { self . check . state (). symbol } " ,
49
+ aggregation_key = aggregation_key ,
40
50
title = text .split ("\n " )[0 ],
41
51
text = text ,
42
52
tags = [
You can’t perform that action at this time.
0 commit comments