-
Notifications
You must be signed in to change notification settings - Fork 200
fix:(drand): SizeTrackingCache cache name per drand network name
#7532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -308,3 +308,36 @@ async fn beacon_entries_for_block_covers_null_rounds_quicknet() { | |
| ); | ||
| } | ||
| } | ||
|
|
||
| #[test] | ||
| #[serial_test::serial] | ||
| fn verified_beacons_cache_metrics_are_uniquely_named() { | ||
| use crate::networks::ChainConfig; | ||
|
|
||
| crate::metrics::reset_collector_registry(); | ||
| // Mainnet has three drand points: Incentinet, Mainnet and Quicknet. | ||
| let schedule = ChainConfig::mainnet().get_beacon_schedule(1598306400); | ||
| assert_eq!(schedule.0.len(), 3); | ||
|
|
||
| let mut encoded = String::new(); | ||
| prometheus_client::encoding::text::encode_registry( | ||
| &mut encoded, | ||
| &crate::metrics::collector_registry(), | ||
| ) | ||
| .unwrap(); | ||
|
|
||
| let families: Vec<_> = encoded | ||
| .lines() | ||
| .filter_map(|line| line.strip_prefix("# HELP ")) | ||
| .filter(|line| line.starts_with("cache_verified_beacons")) | ||
| .map(|line| line.split_whitespace().next().unwrap_or_default()) | ||
| .collect(); | ||
|
|
||
| // Five metrics (size/len/cap/hits/misses) for each of the three beacons. | ||
| assert_eq!(families.len(), 15); | ||
| assert_eq!( | ||
| families.iter().unique().count(), | ||
| families.len(), | ||
| "duplicate cache metric families: {families:?}" | ||
| ); | ||
| } | ||
|
Comment on lines
+311
to
+343
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win Clean up the global collector registry after the test.
🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Classify the metric rename as a breaking observability change.
The change removes the old
cache_verified_beacons_*metric families. Exact-name Prometheus alerts, dashboards, and queries no longer match. Move this entry under### Breakingor add explicit migration guidance for the newcache_verified_beacons_<network>_*names.🤖 Prompt for AI Agents