feat(price_pusher): add gauge metrics for source and target price values #3008
+44
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds two new Prometheus gauge metrics to the price pusher to track actual price values from both Pyth (source) and target chains:
pyth_source_price{price_id, alias}
- Latest price value from Pyth sourcepyth_target_price{price_id, alias}
- Latest price value from target chainThe metrics are updated in the same controller loop where timestamp metrics are already tracked, using consistent labeling and conditional logic.
Rationale
This addresses a debugging need where price discrepancies were observed between UI displays and actual feeds. By exposing the actual price values (not just timestamps) in metrics, operators can monitor and compare price values across different data sources in Grafana dashboards, particularly useful for Solana where the API explorer isn't available.
How has this been tested?
Manual verification:
pnpm turbo build
Human Review Checklist
Please pay special attention to:
Number(sourcePrice)
andNumber(targetPrice)
handle all expected price string formats correctly without runtime errors/metrics
endpoint and can be queried in Grafanapyth_source_price
andpyth_target_price
follow Prometheus naming standardsLink to Devin run: https://app.devin.ai/sessions/2d00dbc3592645519ae39b8e78dfda4d
Requested by: Ali ([email protected])