diff --git a/pyth_observer/dispatch.py b/pyth_observer/dispatch.py index 681e497..886e453 100644 --- a/pyth_observer/dispatch.py +++ b/pyth_observer/dispatch.py @@ -208,7 +208,9 @@ async def process_zenduty_events(self, current_time): logger.debug(f"Raising Zenduty alert {identifier}") self.open_alerts[identifier]["sent"] = True self.open_alerts[identifier]["last_alert"] = current_time.isoformat() - to_alert.append(self.zenduty_events[identifier].send()) + event = self.zenduty_events.get(identifier) + if event: + to_alert.append(event.send()) await asyncio.gather(*to_alert) for identifier in to_remove: diff --git a/pyth_observer/event.py b/pyth_observer/event.py index 301f34e..1fb9a9a 100644 --- a/pyth_observer/event.py +++ b/pyth_observer/event.py @@ -170,6 +170,10 @@ async def send(self): state = self.check.state() if isinstance(state, PublisherState): alert_identifier += f"-{state.publisher_name}" + symbol = self.check.state().symbol.replace(".", "-").replace("/", "-").lower() + cluster = "solana-mainnet-beta" if self.context.network == "mainnet" else self.context.network + publisher_key = state.public_key.key + summary += f"https://pyth.network/metrics?price-feed={symbol}&cluster={cluster}&publisher={publisher_key}\n" logger.debug(f"Sending Zenduty alert for {alert_identifier}") await send_zenduty_alert(