Skip to content

chore(experiments): experiment infra backend config is frozen at the old query_language enum, not aligned with BackendConfig from PR #323 #333

@milindsrivastava1997

Description

@milindsrivastava1997

Problem

_build_engine_config in asap-tools/experiments/experiment_utils/services/query_engine.py was written against the old two-value query_language CLI interface (PROMQL or SQL). PR #323 replaced that with a proper four-variant BackendConfig tagged union in asap-query-engine/src/engine_config.rs:

  • prometheus — PromQL, server URL
  • clickhouse — SQL, url + database
  • elastic_querydsl — Elasticsearch QueryDSL, url + index
  • elastic_sql — Elasticsearch SQL, url + index

The experiment infra was never updated to match, leaving several gaps:

  1. ClickHouse URL is wrong. When query_language="SQL", _build_engine_config reuses prometheus_server (built from prometheus_host:prometheus_port) as the ClickHouse url. The ClickHouse database field is silently dropped entirely.

  2. Elasticsearch backends are unreachable. elastic_querydsl and elastic_sql have no representation in the experiment config or _build_engine_config. There is no way to run an experiment against an Elasticsearch backend.

  3. start() encodes backend config as Prometheus-specific kwargs. prometheus_host and prometheus_port live in **kwargs because they are the infrastructure-level encoding of "where is the backend." This only makes sense for the Prometheus case. Other backends require different fields (database, index), which have no kwargs equivalent.

  4. query_language in Hydra config is the wrong abstraction. config.yaml exposes query_language: PROMQL|SQL as a flat string. The engine now expects a backend: block with a type tag and backend-specific fields.

Affected files

  • asap-tools/experiments/experiment_utils/services/query_engine.py_build_engine_config, start()
  • asap-tools/experiments/config/config.yamlquery_language field
  • All experiment scripts that pass query_language/prometheus_host/prometheus_port to query_engine_service.start()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions