#command #line #metric #bosun

bin+lib bosun_emitter

A command line tool and Rust library to emit metric data to StackExchange's monitoring and alerting system Bosun

8 releases (4 stable)

Uses old Rust 2015

1.2.0 Nov 12, 2018
1.1.0 Jul 13, 2017
1.0.1 Oct 18, 2016
1.0.0 May 4, 2016
0.0.5 Mar 30, 2016

#2072 in Command line utilities

Download history 1/week @ 2022-11-24 12/week @ 2022-12-01 19/week @ 2022-12-08 13/week @ 2022-12-15 8/week @ 2022-12-22 7/week @ 2022-12-29 5/week @ 2023-01-05 3/week @ 2023-01-12 11/week @ 2023-01-19 13/week @ 2023-01-26 16/week @ 2023-02-02 24/week @ 2023-02-09 35/week @ 2023-02-16 4/week @ 2023-02-23 4/week @ 2023-03-02 5/week @ 2023-03-09

54 downloads per month
Used in rs-collector

MIT license

523 lines

Bosun Emitter

Linux & OS X Build Status Windows Build status MIT licensed

A command line tool and Rust library to emit metric data to Bosun.


Bosun is an open-source, MIT licensed, monitoring and alerting system by Stack Exchange. It has an expressive domain specific language for evaluating alerts and creating detailed notifications. It also lets you test your alerts against history for a faster development experience. [1]

Bosun receives metric data mostly via scollector which is Boson's agent running on each monitored host. scollector runs build-in as well as external collectors periodically to collect and transmit metrics on its hosts.

While it is easy to create external collectors suitable for most needs, there are cases in which sending a single, individual metric datum may be helpful. Such cases may comprise any individually run program such as a Cron job for backups or in general any other shell script. Further, it might be helpful to send metric data from your own application.

bosun_emitter is a library that makes it easy to send metric data and corresponding meta data describing the metric. Further, this crate contains a CLI standalone binary called emit_bosun that may be used on the command line or from any shell script to send a single metric datum.


Please see the Rustdoc for documentation of the latest build. You can also find a crate on crates.io and via Cargo.

Command Line Tool


Emit a Bosun

    emit_bosun [FLAGS] [OPTIONS]

    -h, --help           Prints help information
        --show-config    Prints config
    -V, --version        Prints version information
        --verbose        Enables verbose output

    -c, --config <FILE>                         Sets a custom config file
    -d, --description <DESCRIPTION>             Sets metric description
        --host <HOST:PORT>                      Sets Bosun server connection parameters; may include basic auth and https
        --hostname <HOSTNAME>                   Sets hostname
    -m, --metric <METRIC NAME>                  Sets metric name
    -r, --rate <RATE>                           Sets rate type [values: gauge, counter, rate]
    -t, --tags <KEY1=VALUE1,KEY2=VALUE2,...>    Sets tags
    -u, --unit <UNIT>                           Sets metric value unit
    -v, --value <VALUE>                         Sets metric value

Two modes are supported, i.e., sending a datum with meta data or sending only
meta data.  The modes are controlled whether a value `--value` is passed or
not. Please mind that in both cases the meta data is required.


emit_bosun -c examples/scollector.toml --host https://user:password@localhost:8070 --tags 'key1=value1,key2=value2' \
  --metric lukas.test --value 10 \
  --rate gauge --unit Tests -d "Amount of Lukas Tests" \


Source Code

You can find the source code for each release on the GitHub Release page.


Travi CI creates Ubuntu Trusty packages for emit_bosun for each release. Please see the Repository for details.


Rust crate releases can be found on Crates.io.


I'll be happy about suggestions and pull requests.


~531K SLoC