healthchecks-rs/healthchecks
Harsh Shandilya b1b835fc5e
healthchecks: address clippy lint
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
2020-11-03 16:00:11 +05:30
..
examples healthchecks: simplify ping config creation 2020-10-01 13:17:27 +05:30
src healthchecks: address clippy lint 2020-11-03 16:00:11 +05:30
.gitignore monitor: include Cargo lockfile in repository 2020-07-28 17:09:09 +05:30
Cargo.toml all: update and sort dependencies 2020-11-03 14:17:55 +05:30
README.md healthchecks: update feature matrix 2020-10-06 15:30:59 +05:30

healthchecks-rs

A simple Rust library that allows pinging healthchecks.io to indicate success or failure of a task.

Supported API methods

Pinging API

  • Signal success
  • Signal failure
  • Signal start

Management API

  • Get a list of all checks
  • Get a single check
  • Create a new check
  • Update an existing check
  • Pause monitoring of a check
  • Delete check
  • Get a list of check's logged pings
  • Get a list of check's status changes
  • Get a list of existing integrations

Usage

Usage is super simple!

use healthchecks::config::get_config;

fn main() {
    let config = get_config("my-uuid-that-is-definitely-not-real");
    config.report_failure();
    config.report_success();
}

Or if you want to set a custom user agent for filtering purposes (default is healthcheck-rs/$library_version)

use healthchecks::config::get_config;

fn main() {
    let config = get_config("my-uuid-that-is-definitely-not-real").set_user_agent("very-fancy-useragent");
    config.report_failure();
    config.report_success();
}

You can also start a timer to record durations on healthchecks.io.

use healthchecks::config::get_config;

fn main() {
    let config = get_config("my-uuid-that-is-definitely-not-real");
    config.start_timer();
    do_long_running_task();
    config.report_success();
}

Licensing

Dual licensed under Apache 2.0 or MIT at your option.