healthchecks-rs/healthchecks
renovate[bot] 07d70f3fb9
fix(deps): update rust crate uuid to v1.3.0
2023-02-01 11:40:26 +00:00
..
examples healthchecks: fix weird assert 2022-06-01 11:09:43 +05:30
src feat(healthchecks): add support for V2 API behind the v2 feature 2023-01-26 10:41:05 +00:00
.gitignore monitor: include Cargo lockfile in repository 2020-07-28 17:09:09 +05:30
CHANGELOG.md fix(healthchecks): update changelog 2023-01-26 10:43:50 +00:00
Cargo.toml fix(deps): update rust crate uuid to v1.3.0 2023-02-01 11:40:26 +00:00
README.md feat: use workspace dependencies and raise MSRV 2022-09-22 21:12:01 +05:30

README.md

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 (pinging API)

use healthchecks::ping::get_client;

fn main() {
    let config = get_client("073305d2-3582-4dd6-b6a3-425e88583ca2").unwrap();
    config.report_failure();
    config.report_success();
}

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

use healthchecks::ping::get_client;

fn main() {
    let config = get_client("073305d2-3582-4dd6-b6a3-425e88583ca2").unwrap().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::ping::get_client;

fn do_long_running_task() {}

fn main() {
    let config = get_client("073305d2-3582-4dd6-b6a3-425e88583ca2").unwrap();
    config.start_timer();
    do_long_running_task();
    config.report_success();
}

Minimum supported Rust Version

healthchecks' MSRV is 1.64.0

Licensing

Dual licensed under Apache 2.0 or MIT at your option.