-
Notifications
You must be signed in to change notification settings - Fork 213
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
feat: metrics collection #900
Conversation
Lets do this as part of this PR please, trying to keep the minimum deps to an actual minimum. |
src/main.rs
Outdated
#[cfg(feature = "metrics")] | ||
fn init_metrics_collection(metrics_addr: Option<SocketAddr>) -> tokio::task::JoinHandle<()> { | ||
init_metrics(); | ||
tokio::spawn(async move { |
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.
no need to spawn
if we are not going to listen
src/metrics/mod.rs
Outdated
mod service; | ||
|
||
/// Enables metrics collection, otherwise all inc!, record! & observe! calls are no-ops | ||
pub fn init_metrics() { |
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.
is there an actual use case for doing this and not starting the server?
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.
Right away, no. But probably very soon. A quick example would be to have a separate output mechanic we add in like just dump metrics to a file or directly into some local store or push to prometheus. All of which don't require the endpoint itself.
Iroh, | ||
RequestsTotal: Counter: "Total number of requests received", | ||
BytesSent: Counter: "Number of bytes streamed", | ||
BytesReceived: Counter: "Number of bytes received" |
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.
are these metrics actually recorded?
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.
They are not used, mostly set as an example and I've used them for testing stuff out. I expect to refactor these as soon as we start collecting real metrics.
confilct time |
* feat: metrics collection * fmt * make it more cross platform * make metrics server a cli param * CR * CI fixes * cleanup * cleanup * cleanup
This sets us up for collecting metrics throughout the codebase.
Currently the metrics collection
Iroh
is added and meant to be for the general collection of metrics. Not married to the name. Didn't have a better idea and wanted to split it out based on subsystems (the incomingderper
specifically).Follow ups on this: