{"id":33927118,"url":"https://github.com/giangndm/metrics-dashboard-rs","last_synced_at":"2025-12-12T10:44:02.387Z","repository":{"id":210394229,"uuid":"726473277","full_name":"giangndm/metrics-dashboard-rs","owner":"giangndm","description":"Zero-config dashboard with metrics-rs","archived":false,"fork":false,"pushed_at":"2024-11-26T17:04:30.000Z","size":179,"stargazers_count":9,"open_issues_count":8,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-16T01:04:31.876Z","etag":null,"topics":["dashboard","metric-rs","rust","zero-config"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/giangndm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-02T14:02:36.000Z","updated_at":"2025-10-11T15:02:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"bcd24bf2-fe1a-4842-8d6c-610e2d5282f1","html_url":"https://github.com/giangndm/metrics-dashboard-rs","commit_stats":null,"previous_names":["giangndm/metrics-dashboard-rs"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/giangndm/metrics-dashboard-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giangndm%2Fmetrics-dashboard-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giangndm%2Fmetrics-dashboard-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giangndm%2Fmetrics-dashboard-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giangndm%2Fmetrics-dashboard-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giangndm","download_url":"https://codeload.github.com/giangndm/metrics-dashboard-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giangndm%2Fmetrics-dashboard-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27681194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dashboard","metric-rs","rust","zero-config"],"created_at":"2025-12-12T10:44:01.568Z","updated_at":"2025-12-12T10:44:02.372Z","avatar_url":"https://github.com/giangndm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# metrics-dashboard-rs\n\n[![Crates.io](https://img.shields.io/crates/v/metrics-dashboard.svg)](https://crates.io/crates/metrics-dashboard)\n[![Docs.rs](https://docs.rs/metrics-dashboard/badge.svg)](https://docs.rs/metrics-dashboard)\n[![CI](https://github.com/giangndm/metrics-dashboard/workflows/CI/badge.svg)](https://github.com/giangndm/metrics-dashboard-rs/actions)\n\nThis crate provide simple auto-generate dashboard for [metric-rs](https://crates.io/crates/metrics) crate.\n\n## Screenshot\n\n![](./docs/screenshot.png)\n\n## How to use\n\n* run `cargo add metrics-dashboard`\n* include into poem webserver like bellow:\n\n```rust\nuse std::time::Duration;\n\nuse metrics_dashboard::build_dashboard_route;\nuse metrics::{describe_counter, increment_counter};\nuse poem::{\n    get, handler, listener::TcpListener, middleware::Tracing, web::Path, EndpointExt, Route, Server,\n};\n\n#[handler]\nfn hello(Path(name): Path\u003cString\u003e) -\u003e String {\n    format!(\"hello: {name}\")\n}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), std::io::Error\u003e {\n    if std::env::var_os(\"RUST_LOG\").is_none() {\n        std::env::set_var(\"RUST_LOG\", \"poem=debug\");\n    }\n    tracing_subscriber::fmt::init();\n\n    let dashboard_options = DashboardOptions {\n        custom_charts: vec![\n            ChartType::Line {\n                metrics: vec![\n                    \"demo_live_time\".to_string(),\n                    \"demo_live_time_max\".to_string(),\n                ],\n                desc: Some(\"Demo metric line\".to_string()),\n            }\n        ],\n        include_default: true,\n    };\n\n    let app = Route::new()\n        .at(\"/hello/:name\", get(hello))\n        .nest(\"/dashboard/\", build_dashboard_route())\n        .with(Tracing);\n\n    tokio::spawn(async move {\n        describe_counter!(\"demo_metric1\", \"Demo metric1\");\n        loop {\n            tokio::time::sleep(Duration::from_secs(1)).await;\n            increment_counter!(\"demo_metric1\");\n        }\n    });\n\n    tokio::spawn(async move {\n        describe_counter!(\"demo_metric2\", \"Demo metric2\");\n        loop {\n            tokio::time::sleep(Duration::from_secs(1)).await;\n            increment_counter!(\"demo_metric2\");\n        }\n    });\n\n    Server::new(TcpListener::bind(\"0.0.0.0:3000\"))\n        .name(\"hello-world\")\n        .run(app)\n        .await\n}\n```\n\n## License\n\nLicensed under ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the MIT license, without any additional terms or conditions.\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiangndm%2Fmetrics-dashboard-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiangndm%2Fmetrics-dashboard-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiangndm%2Fmetrics-dashboard-rs/lists"}