Skip to main content

Crate forge_ops_tracker

Crate forge_ops_tracker 

Source
Expand description

ForgeOps error tracking client for a private, self-hosted ForgeOps tracker instance:

forge_ops_tracker::init(|c| {
    c.dsn = Some("https://<api_key>@your-forgeops-host/api/v1/events".to_string());
});

See the README for what gets captured automatically vs. what needs an explicit capture_error call. A from-scratch port of gems/forge_ops_tracker (the Rails client) – see that gem’s README for the shared design rationale behind the pieces this crate is built from (Configuration, EventBuilder, DeliveryQueue, Reporter, Client).

Macros§

context
Builds a HashMap<String, Value> from key => value pairs, the same literal-context ergonomics every other client in this repo gets for free from its own language (a Python dict, a JS object literal, a PHP array):

Structs§

Configuration
Holds a single ForgeOps DSN plus everything else the client needs to build and deliver events. Mirrors gems/forge_ops_tracker’s Configuration – a single Sentry-style DSN string carries both the ingestion URL and the project’s API key: “https://<api_key>@host/api/v1/events”.
Event
Frame

Enums§

Value
A JSON-like value – what context/tags are built out of. Hand-rolled rather than depending on serde_json’s Value: this crate already needs regex/backtrace/ureq for things Rust’s standard library genuinely lacks (see README.md’s “Dependencies” section), and a fourth dependency purely for a value type this small isn’t worth it.

Traits§

ResultReportExt
Extension trait for Result, so a fallible call can report its own error and still propagate it in one step:

Functions§

capture_error
Reports an error you’ve already handled. Call it right at the point you’d otherwise just log it:
capture_error_with_class
The same as capture_error, but for a &dyn std::error::Error (a Box<dyn Error>, a trait object) whose concrete type isn’t known at the call site, so exception_class has to be supplied explicitly rather than inferred.
init
Configures the client. Call once at startup, before your server starts accepting requests. Pass a closure to set any Configuration field:
install_panic_hook
Installs a global panic hook that reports any panic on any thread, then calls whatever hook was previously installed (Rust’s own default, which prints to stderr, unless something else already replaced it) – never changing panic behavior itself, the same “report, then don’t change program behavior” rule the .NET middleware and Python excepthook wrapper both follow.