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
Enable node metrics #723
Enable node metrics #723
Conversation
Reviewpad Report
|
const METRICS_CONTENT_TYPE: &str = "application/openmetrics-text;charset=utf-8;version=1.0.0"; | ||
|
||
pub(crate) fn run_metrics_server(registry: Registry) { | ||
// Serve on localhost. |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
sn_networking/src/metrics_service.rs
Outdated
fn respond_with_404_not_found(&mut self) -> Response<String> { | ||
let mut resp = Response::default(); | ||
*resp.status_mut() = StatusCode::NOT_FOUND; | ||
*resp.body_mut() = "Not found try localhost:[port]/metrics".to_string(); |
Check notice
Code scanning / devskim
Accessing localhost could indicate debug code, or could hinder scaling. Note
c3b0068
to
03590a4
Compare
// Serve on localhost. | ||
let addr = ([127, 0, 0, 1], 0).into(); | ||
|
||
tokio::spawn(async move { | ||
let server = Server::bind(&addr).serve(MakeMetricService::new(registry)); | ||
info!("Metrics server on http://{}/metrics", server.local_addr()); | ||
println!("Metrics server on http://{}/metrics", server.local_addr()); |
Check warning
Code scanning / devskim
An HTTP-based URL without TLS was detected. Warning
03590a4
to
adfff42
Compare
- this allows us to enable feature flagged fields to be passed in
adfff42
to
a2362a4
Compare
Depends on #705
Description
Summary generated by Reviewpad on 12 Sep 23 10:03 UTC
This pull request includes several changes across multiple files:
sn_networking/src/error.rs
file introduces new variants to theError
enum related to error handling and network metrics.sn_node/src/metrics.rs
file adds functionality for collecting and recording metrics for the SAFE Network software.sn_node/src/node.rs
file includes changes to support the open-metrics feature, refactor network creation, handle network events, and record metrics.sn_node/src/api.rs
file adds support for metrics using theopen-metrics
feature, replaces theSwarmDriver
implementation, and adds methods for request timeout and concurrency limit.sn_node/src/metrics_service.rs
file adds a metrics server using the Hyper crate and implements theMetricService
struct to handle incoming requests.Cargo.toml
files include changes related to new dependencies, features, and versions.These changes enhance error handling, network metrics, metrics collection and recording, network creation, API functionality, dependency management, and documentation.
Let me know if you need more information or have any questions.