Skip to content

Conversation

cctdaniel
Copy link
Contributor

@cctdaniel cctdaniel commented Apr 24, 2025

Summary

  • Added market hours tracking to price pusher metrics

Rationale

These changes improve the monitoring and alerting system by:

  1. Allowing alerts to trigger only during active market hours, reducing false positives
  2. Providing better visibility into market status through new metrics:
    • pyth_market_is_open: Whether market is currently open (1) or closed (0)
    • pyth_next_market_open: Next market open time in unix timestamp
    • pyth_next_market_close: Next market close time in unix timestamp
  3. Properly handling cleanup to prevent memory leaks and ensure graceful shutdown

Technical Approach

  1. Metrics Integration:

    • Added market hours metrics to PricePusherMetrics class
    • Kept metrics class focused solely on metrics management
    • Initialized market hours updates in network command handlers alongside other services
  2. Efficient Updates:

    • Market hours are fetched from Pyth API every minute
    • Only process feeds configured in price config file
    • Use child loggers for better log organization
    • Proper cleanup on process termination

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

Testing steps:

  1. Verified market hours metrics are only created for configured price feeds
  2. Verified metrics are properly updated at 1-minute intervals
  3. Checked log output for proper debugging information

@cctdaniel cctdaniel requested a review from a team as a code owner April 24, 2025 01:20
Copy link

vercel bot commented Apr 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 1:45am
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 1:45am
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 1:45am
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2025 1:45am
component-library ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2025 1:45am
entropy-debugger ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2025 1:45am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant