Skip to content
Merged
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
27 changes: 0 additions & 27 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[workspace]
resolver = "2"
members = [
"crates/promql_utilities",
"crates/asap_otel_proto",
"crates/asap_types",
"data_plane",
Expand Down Expand Up @@ -44,7 +43,6 @@ tokio = { version = "1.0", features = ["full"] }
arc-swap = "1.7"

# Internal crates
promql_utilities = { path = "crates/promql_utilities" }
asap_types = { path = "crates/asap_types" }
asap_otel_proto = { path = "crates/asap_otel_proto" }
indexmap = { version = "2.0", features = ["serde"] }
1 change: 0 additions & 1 deletion control_plane/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ parking_lot = "0.12"
prometheus = { version = "0.13", default-features = false, features = ["process"] }
tonic = { version = "0.12", features = ["gzip"] }
tokio-stream = { version = "0.1", features = ["net"] }
promql_utilities.workspace = true
asap_types.workspace = true

# Transitional pin (docs/migration-plan-backend-plan.md Phase 1b): locked to a
Expand Down
8 changes: 4 additions & 4 deletions control_plane/src/asap_tier_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ fn duration_to_seconds(d: Duration) -> u64 {
/// serve any ASAP-tier candidate" and skip.
pub fn policy_capability(cfg: &asap_types::AggregationConfig) -> Option<Capability> {
use crate::sketch_algebra::capability::SketchKindHandle;
use promql_utilities::query_logics::enums::AggregationType;
use asap_types::AggregationType;
match cfg.aggregation_type {
// Exact-aggregation families — the ASAP-tier ExactAgg path.
AggregationType::Sum => Some(Capability::ExactAgg(AggregationType::Sum)),
Expand Down Expand Up @@ -735,7 +735,7 @@ pub fn find_policy_by_content(
registry: &asap_types::PolicyRegistry,
metric: &str,
group_by_keys: &BTreeSet<String>,
agg_type: promql_utilities::query_logics::enums::AggregationType,
agg_type: asap_types::AggregationType,
expected_params: &std::collections::HashMap<String, serde_json::Value>,
) -> Option<asap_types::PolicyFingerprint> {
let mut hit: Option<asap_types::PolicyFingerprint> = None;
Expand Down Expand Up @@ -833,7 +833,7 @@ pub fn find_matching_policies(
#[cfg(test)]
mod tests {
use super::*;
use promql_utilities::query_logics::enums::AggregationType;
use asap_types::AggregationType;

fn keys(items: &[&str]) -> BTreeSet<String> {
items.iter().map(|s| s.to_string()).collect()
Expand Down Expand Up @@ -1420,9 +1420,9 @@ mod tests {

mod matching {
use super::super::*;
use asap_types::AggregationType;
use asap_types::KeyByLabelNames;
use asap_types::{AggregationConfig, PolicyFingerprint, PolicyRegistry};
use promql_utilities::query_logics::enums::AggregationType;
use std::collections::HashMap;

fn cfg(
Expand Down
2 changes: 1 addition & 1 deletion control_plane/src/sketch_algebra/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

use crate::intent_algebra::agg_intent::AggIntent;
use crate::types_v2::AccuracyTarget;
use promql_utilities::query_logics::enums::AggregationType;
use asap_types::AggregationType;

// ── Query-side capability tag ────────────────────────────────────────────────

Expand Down
2 changes: 1 addition & 1 deletion control_plane/src/sketch_algebra/physical_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use serde::{Deserialize, Serialize};

use crate::intent_algebra::QueryExpr;
use crate::types_v2::BindingName;
use promql_utilities::query_logics::enums::AggregationType;
use asap_types::AggregationType;

/// Readout operation extracted from a built sketch state. Inverse of
/// `SketchAgg`. Mirrors design.md §6 line ~607 — `SketchEstimate` plus
Expand Down
2 changes: 1 addition & 1 deletion control_plane/src/sketch_algebra/rules/bind_exact_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

use std::time::Duration;

use promql_utilities::query_logics::enums::AggregationType;
use asap_types::AggregationType;

use crate::intent_algebra::{AggIntent, QueryExpr};
use crate::sketch_algebra::physical_expr::PhysicalExpr;
Expand Down
23 changes: 10 additions & 13 deletions control_plane/src/sketch_algebra/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ fn sum_now_binds_to_exact_agg_after_pr_6_followup() {
match bound {
PhysicalExpr::ExactAgg { agg_type, .. } => assert_eq!(
agg_type,
promql_utilities::query_logics::enums::AggregationType::Sum,
asap_types::AggregationType::Sum,
"Sum should bind to ExactAgg(Sum)"
),
other => panic!("expected ExactAgg, got {other:?}"),
Expand Down Expand Up @@ -405,10 +405,9 @@ fn phase_b_pattern_only_temporal_sum_binds_to_exact_agg() {
};
let bound = bind_query_expr(&expr, AccuracyTarget::Epsilon(0.01)).unwrap();
match bound {
PhysicalExpr::ExactAgg { agg_type, .. } => assert_eq!(
agg_type,
promql_utilities::query_logics::enums::AggregationType::Sum,
),
PhysicalExpr::ExactAgg { agg_type, .. } => {
assert_eq!(agg_type, asap_types::AggregationType::Sum,)
}
other => panic!("expected ExactAgg(Sum), got {other:?}"),
}
}
Expand All @@ -429,10 +428,9 @@ fn phase_b_pattern_only_spatial_aggregate_binds_to_multiple_sum() {
};
let bound = bind_query_expr(&expr, AccuracyTarget::Epsilon(0.01)).unwrap();
match bound {
PhysicalExpr::ExactAgg { agg_type, .. } => assert_eq!(
agg_type,
promql_utilities::query_logics::enums::AggregationType::MultipleSum,
),
PhysicalExpr::ExactAgg { agg_type, .. } => {
assert_eq!(agg_type, asap_types::AggregationType::MultipleSum,)
}
other => panic!("expected ExactAgg(MultipleSum), got {other:?}"),
}
}
Expand All @@ -450,10 +448,9 @@ fn phase_b_pattern_temporal_and_spatial_combined_binds_to_multiple_increase() {
};
let bound = bind_query_expr(&expr, AccuracyTarget::Epsilon(0.01)).unwrap();
match bound {
PhysicalExpr::ExactAgg { agg_type, .. } => assert_eq!(
agg_type,
promql_utilities::query_logics::enums::AggregationType::MultipleIncrease,
),
PhysicalExpr::ExactAgg { agg_type, .. } => {
assert_eq!(agg_type, asap_types::AggregationType::MultipleIncrease,)
}
other => panic!("expected ExactAgg(MultipleIncrease), got {other:?}"),
}
}
Expand Down
2 changes: 1 addition & 1 deletion control_plane/src/sketch_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn concrete_or(h: SketchKindHandle, any_set: &[SketchType]) -> Vec<SketchType> {
#[cfg(test)]
mod tests {
use super::*;
use promql_utilities::query_logics::enums::AggregationType;
use asap_types::AggregationType;

#[test]
fn quantile_any_expands_to_ddsketch_and_kll() {
Expand Down
1 change: 0 additions & 1 deletion crates/asap_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version.workspace = true
edition.workspace = true

[dependencies]
promql_utilities.workspace = true
tracing.workspace = true
serde.workspace = true
serde_json.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion crates/asap_types/src/aggregation_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use crate::enums::{QueryLanguage, WindowType};
use crate::policy_fingerprint::PolicyFingerprint;
use crate::traits::SerializableToSink;
use crate::utils::normalize_spatial_filter;
use crate::AggregationType;
use crate::KeyByLabelNames;
use promql_utilities::query_logics::enums::AggregationType;

/// Per-aggregation policy carried in the streaming config.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
//! Formerly `promql_utilities::query_logics::enums::AggregationType` — moved
//! here as the final step of retiring the `promql_utilities` crate (see
//! `scratchpad/artifacts/retirement-plan.html` / the earlier Stage 1-3 work
//! that already moved `Statistic`/`KeyByLabelNames`/`QueryResultType` out of
//! it for the same reason). By the time this moved, `promql_utilities` held
//! nothing but this one type — `asap_types` is its real center of gravity
//! (`compatible_agg_types`, `AggregationConfig`, `PolicyFingerprint`,
//! `capability_matching`), and is the shared foundation both
//! `control_plane`'s ecosystem and `data_plane` can depend on without a
//! cycle, so there was no longer a reason for a separate crate.
//!
//! Note: this is representation **D** in
//! `scratchpad/artifacts/enum-unification-plan.md` — the data-plane's own
//! `AggregationType` + `String` sub-type + untyped params bag, conflating
//! sketch/accumulator identity with a keyed/unkeyed axis. Step 5 of that
//! plan introduced `AccumulatorSpec` as a typed, unconflated replacement
//! (additive so far, not yet fully replacing this type) — this move is
//! purely about which crate `AggregationType` lives in, not a change to
//! its shape or semantics.

use serde::{Deserialize, Serialize};
use std::fmt;
use std::str::FromStr;
Expand Down
2 changes: 1 addition & 1 deletion crates/asap_types/src/capability_matching.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::aggregation_config::{AggregationConfig, AggregationIdInfo};
use crate::enums::WindowType;
use crate::query_requirements::QueryRequirements;
use crate::utils::normalize_spatial_filter;
use promql_utilities::query_logics::enums::AggregationType;
use crate::AggregationType;

pub const ENGINE_ID_ASAP_QUERY: &str = "asap_query";
pub const ENGINE_ID_THANOS_QUERY: &str = "thanos_query";
Expand Down
3 changes: 0 additions & 3 deletions crates/asap_types/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ use std::fmt;
use std::str::FromStr;
use tracing::debug;

// Re-export AggregationType from promql_utilities (defined there to avoid circular deps).
pub use promql_utilities::query_logics::enums::AggregationType;

/// The scalar value a serving-time query wants out of an already-built
/// accumulator: "given a live `AggregateCore` implementation, which
/// number do you want?" Every accumulator's `AggregateCore::query_statistic`
Expand Down
2 changes: 2 additions & 0 deletions crates/asap_types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod aggregation_config;
pub mod aggregation_type;
pub mod capability_matching;
pub mod enums;
pub mod key_by_label_names;
Expand All @@ -10,6 +11,7 @@ pub mod traits;
pub mod utils;

pub use aggregation_config::*;
pub use aggregation_type::AggregationType;
pub use capability_matching::{
compatible_storage_backends, find_compatible_aggregation, parse_storage_backend_engine_id,
AccuracyTarget, StorageBackend, CANONICAL_QUERY_ENGINE_IDS, ENGINE_ID_ASAP_QUERY,
Expand Down
2 changes: 1 addition & 1 deletion crates/asap_types/src/policy_fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ impl std::fmt::Display for PolicyFingerprint {
mod tests {
use super::*;
use crate::enums::WindowType;
use crate::AggregationType;
use crate::KeyByLabelNames;
use promql_utilities::query_logics::enums::AggregationType;
use std::collections::HashMap;

fn cfg(
Expand Down
2 changes: 1 addition & 1 deletion crates/asap_types/src/policy_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ impl PolicyRegistry {
mod tests {
use super::*;
use crate::enums::WindowType;
use crate::AggregationType;
use crate::KeyByLabelNames;
use promql_utilities::query_logics::enums::AggregationType;
use std::collections::HashMap as StdHashMap;

fn cfg(_id: u64, metric: &str) -> AggregationConfig {
Expand Down
1 change: 0 additions & 1 deletion crates/promql_utilities/.gitignore

This file was deleted.

20 changes: 0 additions & 20 deletions crates/promql_utilities/Cargo.toml

This file was deleted.

3 changes: 0 additions & 3 deletions crates/promql_utilities/src/lib.rs

This file was deleted.

3 changes: 0 additions & 3 deletions crates/promql_utilities/src/query_logics/mod.rs

This file was deleted.

1 change: 0 additions & 1 deletion data_plane/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition.workspace = true

[dependencies]
# Internal crates (workspace)
promql_utilities.workspace = true
asap_types.workspace = true
# Phase 9: the control plane is now an in-process library inside the
# backend binary. Wiring up the in-process OpAMP server + capability-map
Expand Down
3 changes: 2 additions & 1 deletion data_plane/benches/sketch_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@ fn bench_query_precomputes_by_agg(c: &mut Criterion) {
/// case, where the per-batch reconcile is pure scan overhead.
fn matching_streaming_config(metric: &str) -> data_plane::storage_engines::types::StreamingConfig {
use asap_types::aggregation_config::AggregationConfig;
use asap_types::enums::{AggregationType as AT, WindowType};
use asap_types::enums::WindowType;
use asap_types::AggregationType as AT;
use asap_types::KeyByLabelNames;
use std::collections::HashMap;

Expand Down
9 changes: 5 additions & 4 deletions data_plane/src/drivers/ingest/otel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1726,9 +1726,9 @@ async fn route_modified_otlp_sketches_to_precompute(
/// fails the (rare) defensive path explicitly.
fn aggregation_type_for_sketch_handle(
handle: crate::storage_engines::sketch_db::index::SketchKindHandle,
) -> Option<promql_utilities::query_logics::enums::AggregationType> {
) -> Option<asap_types::AggregationType> {
use crate::storage_engines::sketch_db::index::SketchKindHandle;
use promql_utilities::query_logics::enums::AggregationType;
use asap_types::AggregationType;
match handle {
SketchKindHandle::DDSketch => Some(AggregationType::DDSketch),
SketchKindHandle::Kll => Some(AggregationType::DatasketchesKLL),
Expand Down Expand Up @@ -2898,7 +2898,7 @@ mod policy_fp_lookup_tests {
use super::*;
use crate::storage_engines::sketch_db::data::SketchConfig;
use crate::storage_engines::sketch_db::index::SketchKindHandle;
use promql_utilities::query_logics::enums::AggregationType;
use asap_types::AggregationType;

#[test]
fn handle_to_agg_type_round_trips_canonical_kinds() {
Expand Down Expand Up @@ -4003,7 +4003,8 @@ mod sid_bucketing_tests {
Metric as PbMetric, NumberDataPoint, ResourceMetrics, ScopeMetrics,
};
use asap_types::aggregation_config::AggregationConfig;
use asap_types::enums::{AggregationType, WindowType};
use asap_types::enums::WindowType;
use asap_types::AggregationType;
use asap_types::KeyByLabelNames;
use std::collections::HashMap;
use std::sync::Arc;
Expand Down
Loading