27 releases

0.8.0 Dec 6, 2023
0.7.4 Sep 5, 2023
0.7.3 Oct 25, 2021
0.7.1 Apr 17, 2021
0.1.0 Oct 25, 2018

#3 in #riemann

Download history 59/week @ 2024-07-27 2/week @ 2024-09-21 5/week @ 2024-09-28

113 downloads per month
Used in metriki-riemann-reporter

MIT/Apache

24KB
555 lines

rustmann

Crates.io Docs Build Status GitHub Donate

A riemann client using tokio. This project is still in its early stage and API changes aggressively.

Usage

See examples and API docs.

Features & TODOs

  • TCP Client
  • TLS TCP Client (by enabling tls feature)
  • UDP Client
  • Report API (send_events)
  • Query API (send_query)
  • Event Builder API

License

MIT/Apache-2.0


lib.rs:

Rustmann

Rustmann is the rust client for riemann, a popular event aggregator and processor for distributed system.

This implementation is based on tokio and using async-await style API.

Features

  • Full async-await API
  • TCP/UDP/TLS transport support
  • Auto reconnect
  • Send and query API
  • EventBuilder
  • A usable Cli in example

Quick Start

use rustmann::{EventBuilder, RiemannClient, RiemannClientError, RiemannClientOptions};

#[tokio::main]
async fn main() -> Result<(), RiemannClientError> {
    // create client with default configuration (to localhost:5555)
    let mut client = RiemannClient::new(&RiemannClientOptions::default());

    // create a riemann event using evnet builder API
    let event = EventBuilder::new()
        .service("riemann_test")
        .state("ok")
        .metric_f(123.4)
        .build();

    // send event to server
    let response = client.send_events(vec![event]).await?;
    println!("{:?}", response);

    // query riemann
    let query_response = client.send_query("service = \"riemann_test\"").await?;
    println!("{:?}", query_response);
    Ok(())
}

See examples for more usage demo.

Dependencies

~5–15MB
~192K SLoC