Skip to content

Commit

Permalink
feat: 📽️ Prometheus XOR streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
fungiboletus committed Sep 30, 2024
1 parent 0cb653c commit fe30734
Show file tree
Hide file tree
Showing 5 changed files with 429 additions and 124 deletions.
35 changes: 23 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ prost = "0.13"
snap = "1.1"
hex = "0.4"
blake3 = "1.5"
regex = "1.10"
regex = "1.11"
influxdb-line-protocol = "2.0"
flate2 = "1.0"
smallvec = "1.13.2"
once_cell = "1.19"
once_cell = "1.20"
urlencoding = "2.1"
hybridmap = "0.1"
clap = { version = "4.5", features = ["derive"] }
Expand Down Expand Up @@ -103,3 +103,5 @@ time = "0.3"
zstd = "0.13"
prometheus-parser = "0.4"
rusty-chunkenc = "0.1.1"
async-stream = "0.3"
itertools = "0.13"
11 changes: 11 additions & 0 deletions src/ingestors/http/app_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use axum::response::IntoResponse;
use axum::response::Response;
use axum::Json;
use serde_json::json;
use std::fmt;

// Anyhow error handling with axum
// https://github.com/tokio-rs/axum/blob/d3112a40d55f123bc5e65f995e2068e245f12055/examples/anyhow-error-response/src/main.rs
Expand Down Expand Up @@ -38,3 +39,13 @@ where
Self::InternalServerError(err.into())
}
}

impl fmt::Display for AppError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
AppError::InternalServerError(error) => write!(f, "Internal Server Error: {}", error),
AppError::NotFound(error) => write!(f, "Not Found: {}", error),
AppError::BadRequest(error) => write!(f, "Bad Request: {}", error),
}
}
}
Loading

0 comments on commit fe30734

Please sign in to comment.