Skip to content

Optimizer: real N_g via Prometheus profiling, hints fallback #525

Description

@milindsrivastava1997

Part of #523 (Track 2: non-empirical gap 3 + empirical gap 4).

  • Add label_group_count: f64 to CandidateConfig (not AQE — anticipates Phase 3 sharing where a config's label set can diverge from any single AQE's), replacing the hardcoded 1.0 in cost_model.rs::ingest_cost/query_cost.
  • Profiled once per AQE (batched before enumerate_candidates, stamped onto every candidate it generates for that AQE) — not once per candidate; the count is identical across an AQE's whole param grid.
  • Data source: live Prometheus query (e.g. count by (labels...) (metric)) alongside the existing build_schema_from_prometheus in prometheus_client.rs, tried first.
  • Fallback: extend MetricDefinition (the metrics: hints block) with an optional label_group_count hint, same priority order as the existing label-schema hints (Prometheus wins when available, hint fills the gap otherwise). Keeps asap-optimizer-cli offline-testable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions