diff --git a/asap-query-engine/src/main.rs b/asap-query-engine/src/main.rs index 8e9bed6e..7685ab80 100644 --- a/asap-query-engine/src/main.rs +++ b/asap-query-engine/src/main.rs @@ -91,7 +91,11 @@ struct Args { /// can generate a new sketch plan. When unset (default), /// capability misses fall through to the §5.2 fallback silently. /// Example: `http://controller.svc:8080/api/v1/plan` - #[arg(long)] + /// + /// Falls back to the `ASAP_CONTROLLER_URL` env var when the flag + /// is not passed — `deploy/docker-compose/base.yml` sets the env + /// var so the MVP demo doesn't need a per-arg overlay. + #[arg(long, env = "ASAP_CONTROLLER_URL")] controller_endpoint: Option, /// Wire protocol for `--controller-endpoint`. `generic` (default) diff --git a/asap-query-engine/src/routing/freshness_probe_cache.rs b/asap-query-engine/src/routing/freshness_probe_cache.rs index c75cb63b..6932e330 100644 --- a/asap-query-engine/src/routing/freshness_probe_cache.rs +++ b/asap-query-engine/src/routing/freshness_probe_cache.rs @@ -64,18 +64,20 @@ use std::collections::HashMap; use std::sync::RwLock; use std::time::{SystemTime, UNIX_EPOCH}; -/// Metric-name prefix the cache filters on. Only metrics whose -/// name starts with this string are captured. Matches the three -/// probe metric names emitted by `deploy/fake-exporter/probes.go` -/// (`http_freshness_probe_raw` / `_warm` / `_archive`). -const PROBE_NAME_PREFIX: &str = "http_freshness_probe_"; +/// Substring the cache filters on. Any metric name containing this +/// token (with the trailing underscore to keep the tier suffix +/// disambiguated) is captured. The MVP fake-exporter emits three +/// probes named `http_freshness_probe_{raw,warm,archive}`; user- +/// extensible probes (e.g. `latency_freshness_probe_*`) are matched +/// without a code change. +const PROBE_NAME_TOKEN: &str = "freshness_probe_"; /// Returns `true` iff the metric name belongs to the freshness-probe /// family — used by both the ingest write path (filter before /// storing) and the query read path (intercept before normal /// routing). pub fn is_freshness_probe(metric: &str) -> bool { - metric.starts_with(PROBE_NAME_PREFIX) + metric.contains(PROBE_NAME_TOKEN) } /// One cached entry: the most-recent `(timestamp, value)` for a