prom-remote-api

Crates.io docs.rs

Prometheus remote storage API for Rust.

Usage

There are two interfaces in Prometheus remote storage API: 1. write 2. read

Both interfaces use a snappy-compressed protocol buffer encoding over HTTP.

This crate use prost-build to convert remote storage protocol buffer definitions to Rust code, and expose a RemoteStorage trait for any third-party storage to integrate with Prometheus.

```rust

[async_trait]

pub trait RemoteStorage { /// Write samples to remote storage async fn write(&self, req: WriteRequest) -> Result<()>;

/// Read samples from remote storage
async fn read(&self, req: ReadRequest) -> Result<ReadResponse>;

} ```

See simple.rs to learn how to build a remote storage with warp web framework.

In future, more web framework will be supported.