[][src]Crate rustmann

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.

Modules

protos

Structs

EventBuilder

Riemann event data builder

RiemannClient
RiemannClientOptions

Riemann connection options

RiemannClientOptionsBuilder

Builder for RiemannClientOptions.

Enums

RiemannClientError

The error type