Crate axiom_rs

source ·
Expand description

The Rust SDK for Axiom.

If you’re just getting started, take a look at the Client. It contains all methods you’ll need to interact with the API.

Examples

use axiom_rs::{Client, Error};
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Error> {
    let client = Client::new()?;

    // Create a dataset called my-dataset
    let dataset = client.datasets.create("my-dataset", "a description").await?;

    // Ingest one event
    client.ingest(&dataset.name, vec![
        json!({"foo": "bar"})
    ]).await?;

    // Query the dataset
    let query_res = client.query(r#"['my-dataset']"#, None).await?;
    dbg!(query_res.matches);

    // Delete the dataset
    client.datasets.delete(dataset.name).await?;

    Ok(())
}

Re-exports

Modules

  • The top-level client for the Axiom API.
  • Manage datasets, ingest data and query it.
  • Error type definitions.
  • Rate-limit type definitions.
  • Manage users and roles.