Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[workspace]
resolver = "2"
members = [
"crates/adapters/ingest/prometheus-remote-write",
"crates/adapters/query/prometheus-http",
"crates/common",
"crates/control-plane",
"crates/data-plane",
Expand Down Expand Up @@ -44,6 +46,8 @@ control_plane = { path = "crates/control-plane" }
common = { path = "crates/common" }
internal_metrics = { path = "crates/internal-metrics" }
precompute = { path = "crates/precompute" }
prometheus_http = { path = "crates/adapters/query/prometheus-http" }
prometheus_remote_write = { path = "crates/adapters/ingest/prometheus-remote-write" }
query = { path = "crates/query" }
storage = { path = "crates/storage" }

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ not stored) with a Prometheus `execution` error (422,
| `crates/query/` | package `query`: planned queries on the query workers, and the result cache |
| `crates/storage/` | package `storage`: raw samples and views in memory, the view cache, segments, persistence and the persist threads |
| `crates/internal-metrics/` | package `internal_metrics`: the backend's measurements of itself, exported on `/metrics` |
| `crates/adapters/ingest/prometheus-remote-write/` | package `prometheus_remote_write`: Remote Write v1 decoding and validation |
| `crates/adapters/query/prometheus-http/` | package `prometheus_http`: query parameters, response bodies and the fallback client of a Prometheus-compatible server |
| `benchmarks/` | the backend alone: `micro/` benchmarks (examples of `data_plane`) and `scripts/` |
| `eval/` | comparisons with other systems and the live demo; see [eval/README.md](eval/README.md) |
| `deployment/monitoring/` | Prometheus, exporters and Grafana for the demo and the comparisons |
Expand Down
5 changes: 2 additions & 3 deletions benchmarks/micro/decode_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ static ALLOCATOR: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

use std::time::Instant;

use data_plane::remote_write::{
decode_samples, encode, Label, Limits, Sample, TimeSeries, WriteRequest,
};
use data_plane::remote_write::decode_samples;
use prometheus_remote_write::{encode, Label, Limits, Sample, TimeSeries, WriteRequest};

fn request(series: usize, samples_per_series: usize) -> Vec<u8> {
let timeseries = (0..series)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/micro/ingest_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ use axum::body::Body;
use axum::http::{Request, StatusCode};
use control_plane::{plan_workload, DeploymentInputs};
use data_plane::engine::EngineOptions;
use data_plane::remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use data_plane::{router, DataPlane};
use internal_metrics::thread_cpu_seconds;
use precompute::engine::PrecomputeMode;
use precompute::ingestion::IngestionOptions;
use prometheus_remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use tower::ServiceExt;

#[tokio::main(flavor = "multi_thread")]
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/micro/matrix_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use std::collections::BTreeMap;
use std::sync::Arc;
use std::time::Instant;

use data_plane::prometheus::range_response_body;
use query::ResultSample;
use common::ResultSample;
use prometheus_http::range_response_body;

fn main() {
let args: Vec<usize> = std::env::args()
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/micro/offset_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use axum::http::{Request, StatusCode};
use axum::Router;
use control_plane::plan_workload;
use data_plane::engine::EngineOptions;
use data_plane::remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use data_plane::{router, DataPlane};
use http_body_util::BodyExt;
use precompute::ingestion::IngestionOptions;
use prometheus_remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use serde_json::json;
use tower::ServiceExt;

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/micro/range_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ use axum::http::{Request, StatusCode};
use axum::Router;
use control_plane::{plan_workload, DeploymentInputs};
use data_plane::engine::EngineOptions;
use data_plane::remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use data_plane::{router, DataPlane, EXECUTION_HEADER};
use http_body_util::BodyExt;
use internal_metrics::thread_cpu_seconds;
use precompute::ingestion::IngestionOptions;
use prometheus_remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use tower::ServiceExt;

const STEP_MS: i64 = 15_000;
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/micro/rw_corpus_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ static ALLOCATOR: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
use std::sync::mpsc;
use std::time::Instant;

use data_plane::remote_write::{decode_samples, Limits};
use data_plane::remote_write::decode_samples;
use internal_metrics::thread_cpu_ns;
use prometheus_remote_write::Limits;
use storage::store::RawSample;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/micro/tier_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ use axum::http::{Request, StatusCode};
use axum::Router;
use control_plane::{plan_workload, DeploymentInputs};
use data_plane::engine::EngineOptions;
use data_plane::remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use data_plane::{router, DataPlane};
use http_body_util::BodyExt;
use precompute::ingestion::IngestionOptions;
use prometheus_remote_write::{encode, Label, Sample, TimeSeries, WriteRequest};
use storage::persist::ViewRead;
use tower::ServiceExt;

Expand Down
16 changes: 16 additions & 0 deletions crates/adapters/ingest/prometheus-remote-write/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "prometheus_remote_write"
version.workspace = true
edition.workspace = true

# Prometheus Remote Write v1: request decoding and validation. An adapter:
# no workspace dependency, so it never sees an engine or a store. The
# caller interns each series into its own series type (`Decoder`).
[dependencies]
prost = "0.13"
snap = "1.1"
# The decoder's series cache (a table of indices hashed by the keys they
# point to).
ahash = "0.8"
hashbrown = "0.15"
thiserror.workspace = true
Loading