13 releases (breaking)

new 0.11.1 May 16, 2025
0.11.0 Sep 13, 2024
0.10.0 Jun 17, 2024
0.9.0 Nov 30, 2023
0.2.1 Jul 22, 2022

#77 in HTTP client

Download history 997/week @ 2025-01-29 1580/week @ 2025-02-05 1321/week @ 2025-02-12 1808/week @ 2025-02-19 2022/week @ 2025-02-26 2744/week @ 2025-03-05 2987/week @ 2025-03-12 2921/week @ 2025-03-19 3463/week @ 2025-03-26 4551/week @ 2025-04-02 8190/week @ 2025-04-09 5779/week @ 2025-04-16 2528/week @ 2025-04-23 6276/week @ 2025-04-30 7488/week @ 2025-05-07 7832/week @ 2025-05-14

24,890 downloads per month
Used in tracing-layer-axiom

MIT/Apache

110KB
2.5K SLoC

axiom-rs docs.rs build crates.io License

use axiom_rs::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Auto-configure the client from the environment variable AXIOM_TOKEN:
    let client = Client::new()?;

    client
        .ingest(
            "DATASET_NAME",
            vec![json!({
                "foo": "bar",
            })],
        )
        .await?;
    let _res = client
        .query(r#"['DATASET_NAME'] | where foo == "bar" | limit 100"#, None)
        .await?;
    Ok(())
}

Install

cargo add axiom-rs

Optional features

You can use the Cargo features:

  • default-tls: Provides TLS support to connect over HTTPS. Enabled by default.
  • native-tls: Enables TLS functionality provided by native-tls.
  • rustls-tls: Enables TLS functionality provided by rustls.
  • tokio: Enables usage with the tokio runtime. Enabled by default.
  • async-std: Enables usage with the async-std runtime.

Documentation

Read documentation on axiom.co/docs/guides/rust.

License

MIT or Apache

Dependencies

~9–23MB
~340K SLoC