{"id":15805996,"url":"https://github.com/qnighy/mightybadger-rs","last_synced_at":"2025-04-21T08:31:40.751Z","repository":{"id":37985170,"uuid":"212967097","full_name":"qnighy/mightybadger-rs","owner":"qnighy","description":"Yet another Honeybadger notifier for Rust","archived":false,"fork":false,"pushed_at":"2023-05-01T03:58:13.000Z","size":151,"stargazers_count":5,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-06T02:41:28.655Z","etag":null,"topics":["error-handling","honeybadger","honeybadger-notifier","rust","rust-bindings"],"latest_commit_sha":null,"homepage":null,"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/qnighy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2019-10-05T08:24:29.000Z","updated_at":"2022-12-27T08:33:44.000Z","dependencies_parsed_at":"2024-10-05T02:41:21.243Z","dependency_job_id":"6e034d30-a8bf-49d5-ac8e-218c4cd06793","html_url":"https://github.com/qnighy/mightybadger-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Fmightybadger-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Fmightybadger-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Fmightybadger-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qnighy%2Fmightybadger-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qnighy","download_url":"https://codeload.github.com/qnighy/mightybadger-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250023520,"owners_count":21362414,"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","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":["error-handling","honeybadger","honeybadger-notifier","rust","rust-bindings"],"created_at":"2024-10-05T02:41:12.112Z","updated_at":"2025-04-21T08:31:40.509Z","avatar_url":"https://github.com/qnighy.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Honeybadger Notifier for Rust\n\n[Honeybadger](https://www.honeybadger.io/) is an error-tracking service run by Honeybadger Industries LLC.\n\n`mightybadger-rs` is an unofficial Honeybadger notifier for Rust, which hooks into panics and error responses, collects related information, and sends reports to the Honeybadger API server.\n\nIn addition to standalone configuration, it provides middlewares for [Rocket](https://rocket.rs/), [Gotham](https://gotham.rs/), and [Actix Web](https://actix.rs/).\n\n## Standalone\n\n```toml\n[dependencies]\nmightybadger = { git = \"https://github.com/qnighy/mightybadger-rs.git\", rev = \"da98547\" }\n```\n\n```rust\nextern crate mightybadger;\n\nuse std::fs::File;\n\nfn main() {\n    mightybadger::setup();\n\n    match File::open(\"quux.quux\") {\n        Ok(_) =\u003e eprintln!(\"quux.quux exists.\"),\n        Err(e) =\u003e mightybadger::notify(\u0026e),\n    };\n\n    panic!(\"test panic\");\n}\n```\n\n```\nHONEYBADGER_API_KEY=your_own_api_key cargo run\n```\n\n## With Rocket\n\n```toml\n[dependencies]\nmightybadger = { git = \"https://github.com/qnighy/mightybadger-rs.git\", rev = \"da98547\" }\nmightybadger-rocket = { git = \"https://github.com/qnighy/mightybadger-rocket.git\", rev = \"da98547\" }\n```\n\n```rust\nextern crate mightybadger;\nextern crate mightybadger_rocket;\n\n...\n\nfn main() {\n    mightybadger::setup();\n    rocket::ignite()\n        ...\n        .attach(mightybadger_rocket::HoneybadgerHook::new())\n        .launch();\n}\n```\n\n## With Gotham\n\n```toml\n[dependencies]\nmightybadger = { git = \"https://github.com/qnighy/mightybadger-rs.git\", rev = \"da98547\" }\nmightybadger-gotham = { git = \"https://github.com/qnighy/mightybadger-gotham.git\", rev = \"da98547\" }\n```\n\n```rust\nextern crate mightybadger;\nextern crate mightybadger_gotham;\n\n...\n\nfn router() -\u003e Router {\n    let (chain, pipelines) = single_pipeline(\n        new_pipeline()\n            .add(mightybadger_gotham::HoneybadgerMiddleware)\n            .build(),\n    );\n    build_router(chain, pipelines, |route| { ... })\n}\n\n...\n\nfn main() {\n    mightybadger::setup();\n    gotham::start(..., router())\n}\n```\n\n\n## With Actix Web\n\n```toml\n[dependencies]\nmightybadger = { git = \"https://github.com/qnighy/mightybadger-rs.git\", rev = \"da98547\" }\nmightybadger-actix-web = { git = \"https://github.com/qnighy/mightybadger-actix-web.git\", rev = \"da98547\" }\n```\n\n```rust\nextern crate mightybadger;\nextern crate mightybadger_actix_web;\n\n...\n\nfn main() {\n    mightybadger::setup();\n\n    server::new(|| {\n        App::new()\n            .middleware(mightybadger_actiX_web::HoneybadgerMiddleware::new())\n            ..\n    }).bind(..)\n        .unwrap()\n        .run();\n}\n```\n\n## Configuration\n\nIt automatically reads the following environment variables at `mightybadger::setup()`:\n\n- `HONEYBADGER_API_KEY`\n- `HONEYBADGER_ENV`\n- `HONEYBADGER_REPORT_DATA`\n- `HONEYBADGER_ROOT`\n- `HONEYBADGER_REVISION`\n- `HONEYBADGER_HOSTNAME`\n\nMoreover, you can programmatically configure the Honeybadger client as follows:\n\n```rust\nfn main() {\n    mightybadger::setup();\n    mightybadger::configure(|config| {\n        if config.api_key.is_none() {\n            config.api_key = Some(\"abcd1234\".to_string());\n        }\n        config.env = Some(\"production\".to_string());\n        config.report_data = Some(true);\n        config.root = Some(\"/home/ubuntu/app\".to_string());\n        config.revision = Some(\"0123456789abcdef0123456789abcdef01234567\".to_string());\n        config.hostname = Some(\"api.example.com\".to_string());\n        config.request.filter_keys = Some(vec![\n            \"password\".to_string(),\n            \"HTTP_AUTHORIZATION\".to_string(),\n            \"passcode\".to_string(),\n        ]);\n    });\n}\n```\n\n## Development Status\n\n**Note**: it's still in its early stage and the Rust API is subject to change. I strongly recommend you to insert `rev = \"..\"` attribute in the dependencies to prevent breakage.\n\n- [x] Assemble notification payload\n  - [x] Notifier information\n  - [x] Error messages\n  - [x] Backtraces\n  - [x] Error classes\n    - [ ] Custom error classes\n  - [x] Error chain\n  - [ ] Server information from global configuration\n  - [x] Stats from `/proc`\n- [x] Send the payload to the Honeybadger API server\n- [x] Panic hook\n- [x] Notify custom errors with [failure](https://github.com/rust-lang-nursery/failure)\n- [x] Pluggable RequestInfo injection\n  - [ ] Built-in support for futures/tokio\n- [ ] Context injection\n- Framework supports\n  - [x] Rocket: RequestInfo injection\n    - [x] CGI Data\n    - [ ] URL\n    - [ ] Query Params\n    - [ ] Rails-like component\n    - [ ] Rails-like action\n    - [ ] Session\n  - [ ] Rocket: error response hook\n  - [x] Gotham: RequestInfo injection\n    - [x] CGI Data\n    - [ ] URL\n    - [ ] Query Params\n    - [ ] Rails-like component\n    - [ ] Rails-like action\n    - [ ] Session\n  - [ ] Gotham: error response hook\n  - [x] Actix Web: RequestInfo injection (error response only)\n    - [x] CGI Data\n    - [x] URL (except for hostname)\n    - [x] Query Params\n    - [ ] Rails-like component\n    - [ ] Rails-like action\n    - [ ] Session\n  - [x] Actix Web: error response hook\n  - [ ] Iron\n  - [ ] Nickel\n  - [ ] Rouille\n- [x] Password filtering\n- [x] Global configuration via environment variables\n- [ ] Global configuration via YAML\n- [x] Global configuration via Rust functions\n- [x] Travis\n- [ ] Docs\n- [ ] Rust API stabilization\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqnighy%2Fmightybadger-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqnighy%2Fmightybadger-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqnighy%2Fmightybadger-rs/lists"}