-
-
Notifications
You must be signed in to change notification settings - Fork 3
fix: wire up missing Prometheus metrics #102
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
Merged
lance0
merged 10 commits into
lance0:main
from
bswinnerton:fix/wire-up-prometheus-metrics
Apr 3, 2026
+175
−10
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
29013cc
fix: wire up events_ingested and events_rejected metrics
bswinnerton 9627f23
fix: wire up mitigation lifecycle metrics
bswinnerton 3791723
fix: wire up announcements_total and announcements_latency metrics
bswinnerton ff560ab
fix: wire up reconciliation_runs and bgp_session_up metrics
bswinnerton d46eeda
fix: wire up guardrail_rejections metric
bswinnerton acad859
fix: fix type mismatches in metrics label values
bswinnerton 847dcf6
style: run cargo fmt
bswinnerton bcb49ce
refactor: drop peer label from announcement metrics
bswinnerton ce9a72b
fix: remove announcement metrics from error paths
bswinnerton 2476761
refactor: change ANNOUNCEMENTS_LATENCY from HistogramVec to Histogram
bswinnerton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| use once_cell::sync::Lazy; | ||
| use prometheus::{ | ||
| CounterVec, Encoder, GaugeVec, HistogramVec, TextEncoder, register_counter_vec, | ||
| register_gauge_vec, register_histogram_vec, | ||
| CounterVec, Encoder, GaugeVec, Histogram, HistogramVec, TextEncoder, register_counter_vec, | ||
| register_gauge_vec, register_histogram, register_histogram_vec, | ||
| }; | ||
|
|
||
| // Event metrics | ||
|
|
@@ -65,16 +65,15 @@ pub static ANNOUNCEMENTS_TOTAL: Lazy<CounterVec> = Lazy::new(|| { | |
| register_counter_vec!( | ||
| "prefixd_announcements_total", | ||
| "Total number of BGP announcements", | ||
| &["peer", "status"] | ||
|
Contributor
Author
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. I couldn't find an easy way to derive the I also moved over to a crate::observability::metrics::ANNOUNCEMENTS_LATENCY
.with_label_values(&[] as &[&str]) |
||
| &["status"] | ||
| ) | ||
| .unwrap() | ||
| }); | ||
|
|
||
| pub static ANNOUNCEMENTS_LATENCY: Lazy<HistogramVec> = Lazy::new(|| { | ||
| register_histogram_vec!( | ||
| pub static ANNOUNCEMENTS_LATENCY: Lazy<Histogram> = Lazy::new(|| { | ||
| register_histogram!( | ||
| "prefixd_announcements_latency_seconds", | ||
| "BGP announcement latency in seconds", | ||
| &["peer"], | ||
| vec![0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0] | ||
| ) | ||
| .unwrap() | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
This is a little clunky but does the trick. If we wanted to take a dependency on strum, we could clean this up to be something like: