Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazabbas committed May 9, 2024
1 parent ba189cf commit b8593fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion pyth_observer/check/price_feed.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import time
from dataclasses import dataclass
from datetime import datetime
from textwrap import dedent
from typing import Dict, Optional, Protocol, runtime_checkable
from zoneinfo import ZoneInfo

Expand Down
1 change: 0 additions & 1 deletion pyth_observer/check/publisher.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from dataclasses import dataclass
from textwrap import dedent
from typing import Dict, Protocol, runtime_checkable

from pythclient.pythaccounts import PythPriceStatus
Expand Down
9 changes: 5 additions & 4 deletions pyth_observer/event.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import os
from typing import Dict, Literal, Protocol, TypedDict, cast
from typing import Dict, Protocol, TypedDict, cast

import aiohttp
from datadog_api_client.api_client import AsyncApiClient as DatadogAPI
Expand Down Expand Up @@ -38,7 +39,7 @@ def __init__(self, check: Check, context: Context):
async def send(self):
# Publisher checks expect the key -> name mapping of publishers when
# generating the error title/message.
text = self.check.error_message()
event = self.check.error_message()

# An example is: PriceFeedOfflineCheck-Crypto.AAVE/USD
aggregation_key = f"{self.check.__class__.__name__}-{self.check.state().symbol}"
Expand All @@ -50,8 +51,8 @@ async def send(self):

event = EventCreateRequest(
aggregation_key=aggregation_key,
title=text.split("\n")[0],
text=text,
title=event["msg"],
text=json.dumps(event),
tags=[
"service:observer",
f"network:{self.context['network']}",
Expand Down

0 comments on commit b8593fd

Please sign in to comment.