Skip to content
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): dockerized grafana dashboard to visualize node metrics #796

Merged
merged 10 commits into from Oct 5, 2023

Conversation

RolandSherwin
Copy link
Member

@RolandSherwin RolandSherwin commented Oct 4, 2023

Description

The ./metrics/readme.md contains the steps to start the dashboard. Should be as simple as executing a single command.

Summary generated by Reviewpad on 04 Oct 23 11:33 UTC

This pull request includes the following changes:

  1. The Cargo.toml file:

    • A new member, "metrics", has been added to the workspace.
  2. The Cargo.lock file:

    • Multiple package versions have been updated.
  3. The metrics/README.md file:

    • Instructions for collecting and visualizing metrics from Safe Network nodes using Prometheus and Grafana have been added.
  4. The metrics/Cargo.toml file:

    • The version of the walkdir dependency has been updated.
  5. The metrics/dashboard.yml file:

    • A new configuration file for a Grafana dashboard has been added.
  6. The metrics/docker-compose.yml file:

    • A new Docker Compose configuration for running Prometheus and Grafana services has been added.
  7. The lib.rs file:

    • Two new modules, "metrics" and "metrics_service", have been added under the "open-metrics" feature.
  8. The event.rs file:

    • Conditional compilation attributes have been added to record Kademlia and Gossipsub events for network metrics.
  9. The main.rs file:

    • Various changes have been made, including import statements, definition of constants and data structures, and implementation of functions related to metrics collection.

Please review these changes carefully and ensure they are intended. Let me know if you need more information or have any questions.

@reviewpad reviewpad bot requested a review from bochaco October 4, 2023 11:33
@reviewpad reviewpad bot added Large Large sized PR waiting-for-review labels Oct 4, 2023
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> url
url: http://prometheus:9090

Check warning

Code scanning / devskim

An HTTP-based URL without TLS was detected. Warning

Insecure URL
metrics/src/main.rs Fixed Show fixed Hide fixed
@RolandSherwin RolandSherwin force-pushed the mem_metrics branch 4 times, most recently from 153fdaf to 093639c Compare October 4, 2023 13:53
));
}

println!("Grafana dashboard is running at http://localhost:3001/d/node_metrics/node-metrics?orgId=1&refresh=5s");

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
@RolandSherwin RolandSherwin force-pushed the mem_metrics branch 2 times, most recently from 9eb0ff5 to 682b697 Compare October 5, 2023 06:50
@@ -19,8 +19,8 @@
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.
let addr = ([127, 0, 0, 1], 0).into();
// The server should not bind to localhost/127.0.0.1 as it will not accept connections from containers.

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
@@ -19,8 +19,8 @@
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.
let addr = ([127, 0, 0, 1], 0).into();
// The server should not bind to localhost/127.0.0.1 as it will not accept connections from containers.

Check notice

Code scanning / devskim

Accessing localhost could indicate debug code, or could hinder scaling. Note

Do not leave debug code in production
@RolandSherwin RolandSherwin added this pull request to the merge queue Oct 5, 2023
Merged via the queue into maidsafe:main with commit d506379 Oct 5, 2023
28 checks passed
@RolandSherwin RolandSherwin deleted the mem_metrics branch October 5, 2023 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Large Large sized PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants