Skip to content

asap-planner-rs: accept Prometheus query log as input #239

@milindsrivastava1997

Description

@milindsrivastava1997

Problem

asap-planner-rs currently requires a pre-defined, repeating query workload as input. Users with an existing Prometheus-Grafana stack cannot easily feed their real query workload into the planner without manually specifying queries.

Goal

Allow asap-planner-rs to accept a Prometheus query log file as input and auto-generate sketch configurations from it.

Details

Prometheus exposes a query log via the --query.log-file flag. The log is newline-delimited JSON, one entry per query, with fields including params.query (the PromQL expression) and ts (timestamp).

asap-planner-rs should:

  • Accept a --query-log flag pointing to a Prometheus query log file
  • Parse the log and extract unique PromQL expressions
  • Deduplicate and rank queries by frequency
  • Generate inference_config.yaml and streaming_config.yaml from the extracted workload, using the same logic as the existing config generation path

Acceptance Criteria

  • asap-planner-rs --query-log /path/to/query.log produces valid sketch configs
  • Handles malformed or partial log lines gracefully (skip and warn)
  • Works with query logs of at least 100k entries without excessive memory use
  • Documented with an example query log snippet

Notes

This is a stepping stone toward passive always-on auto-discovery (tracked separately). Users run this once to bootstrap their config from historical traffic.

Metadata

Metadata

Type

No type
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