9 releases (breaking)

new 0.8.0 Jan 26, 2023
0.7.0 Nov 28, 2022
0.6.0 Oct 26, 2022
0.5.0 Sep 19, 2022
0.1.0 Jul 6, 2022

#467 in Network programming

Download history 29/week @ 2022-10-07 28/week @ 2022-10-14 57/week @ 2022-10-21 47/week @ 2022-10-28 48/week @ 2022-11-04 36/week @ 2022-11-11 38/week @ 2022-11-18 143/week @ 2022-11-25 112/week @ 2022-12-02 64/week @ 2022-12-09 35/week @ 2022-12-16 47/week @ 2022-12-23 47/week @ 2022-12-30 46/week @ 2023-01-06 106/week @ 2023-01-13 166/week @ 2023-01-20

378 downloads per month
Used in tracing-axiom

MIT/Apache

82KB
2K SLoC

axiom-rs: The official Rust bindings for the Axiom API axiom-rs: The official Rust bindings for the Axiom API

docs.rs build crates.io License

Axiom unlocks observability at any scale.

  • Ingest with ease, store without limits: Axiom’s next-generation datastore enables ingesting petabytes of data with ultimate efficiency. Ship logs from Kubernetes, AWS, Azure, Google Cloud, DigitalOcean, Nomad, and others.
  • Query everything, all the time: Whether DevOps, SecOps, or EverythingOps, query all your data no matter its age. No provisioning, no moving data from cold/archive to “hot”, and no worrying about slow queries. All your data, all. the. time.
  • Powerful dashboards, for continuous observability: Build dashboards to collect related queries and present information that’s quick and easy to digest for you and your team. Dashboards can be kept private or shared with others, and are the perfect way to bring together data from different sources

For more information check out the official documentation and our community Slack.

Quickstart

Add the following to your Cargo.toml:

[dependencies]
axiom-rs = "0.8"

If you use the Axiom CLI, run eval $(axiom config export -f) to configure your environment variables.

Otherwise create a personal token in the Axiom settings and make note of the organization ID from the settings page of the organization you want to access.

Create and use a client like this:

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

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Build your client by providing a personal token and an org id:
    let client = Client::builder()
        .with_token("my-token")
        .with_org_id("my-org")
        .build()?;

    // Alternatively you autoconfigure the client from the environment variables
    // AXIOM_TOKEN and AXIOM_ORG_ID:
    let client = Client::new()?;

    client.datasets.create("my-dataset", "").await?;

    client
        .ingest(
            "my-dataset",
            vec![json!({
                "foo": "bar",
            })],
        )
        .await?;

    let res = client
        .query(r#"['my-dataset'] | where foo == "bar" | limit 100"#, None)
        .await?;
    println!("{:?}", res);

    client.datasets.delete("my-dataset").await?;
    Ok(())
}

For further examples, head over to the examples directory.

Optional Features

The following are a list of Cargo features that can be enabled or disabled:

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

License

Licensed under either of

at your option.

Dependencies

~8–16MB
~316K SLoC