#health-check #io #applications #api #failure #task #success

healthchecks

Simple library to notify healthchecks.io from inside applications

17 stable releases (3 major)

3.1.6 Aug 12, 2023
3.1.5 Jul 3, 2023
3.1.4 Jan 26, 2023
3.1.3 Oct 26, 2022
0.1.0 Jun 5, 2020

#846 in Web programming

Download history 66/week @ 2023-11-20 59/week @ 2023-11-27 26/week @ 2023-12-04 23/week @ 2023-12-11 18/week @ 2023-12-18 13/week @ 2023-12-25 27/week @ 2024-01-01 9/week @ 2024-01-08 4/week @ 2024-01-15 25/week @ 2024-01-22 23/week @ 2024-01-29 64/week @ 2024-02-05 25/week @ 2024-02-12 51/week @ 2024-02-19 84/week @ 2024-02-26 79/week @ 2024-03-04

246 downloads per month
Used in 2 crates

MIT/Apache

43KB
538 lines

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.

Dependencies

~3–4.5MB
~118K SLoC