From Natural Language to PromQL: A Catalog-Driven Framework with Dynamic Temporal Resolution for Cloud-Native Observability
Abstract
Modern cloud-native platforms expose thousands of time series metrics through systems like Prometheus, yet formulating correct queries in domain-specific languages such as PromQL remains a significant barrier for platform engineers and site reliability teams. We present a catalog-driven framework that translates natural language questions into executable PromQL queries, bridging the gap between human intent and observability data. Our approach introduces three contributions: (1) a hybrid metrics catalog that combines a statically curated base of approximately 2,000 metrics with runtime discovery of hardware-specific signals across GPU vendors, (2) a multi-stage query pipeline with intent classification, category-aware metric routing, and multi-dimensional semantic scoring, and (3) a dynamic temporal resolution mechanism that interprets diverse natural language time expressions and maps them to appropriate PromQL duration syntax. We integrate the framework with the Model Context Protocol (MCP) to enable tool-augmented LLM interactions across multiple providers. The catalog-driven approach achieves sub-second metric discovery through pre-computed category indices, with the full pipeline completing in approximately 1.1 seconds via the catalog path. The system has been deployed on production Kubernetes clusters managing AI inference workloads, where it supports natural language querying across approximately 2,000 metrics spanning cluster health, GPU utilization, and model-serving performance.
Figures & tables
| Vendor | Default Prefixes | Key High-Priority Metrics |
|---|---|---|
| NVIDIA | DCGM_* , nvidia_gpu_* | Utilization, temperature, power, VRAM |
| Intel | habanalabs_* , xpu_* | HPU utilization, energy, memory, PCIe |
| AMD | amdgpu_* , rocm_* | GPU busy %, VRAM, temperature |
| Framework | vllm:* , gpu_* | TTFT, ITL, KV cache, throughput |
| Intent | Trigger Keywords | PromQL Pattern |
|---|---|---|
| current_value | “current”, “now”, “what is” | Instant query |
| count | “how many”, “total” | count() |
| average | “average”, “mean” | avg() |
| percentile | “p95”, “p99”, “distribution” | histogram_quantile() |
| top_n | “top”, “highest”, “busiest” | topk() |
| comparison | “compare”, “versus” | by (label) |
| Pattern Category | Weight |
|---|---|
| TTFT / TPOT / ITL exact match | +20 |
| GPU / CUDA / DCGM / vLLM keywords | +15 |
| Temperature keywords | +15 |
| Memory / token / cache keywords | +12 |
| CPU / network keywords | +12 |
| Latency / error keywords | +10 |
| Intent | Counter | Gauge | Histogram |
|---|---|---|---|
| rate | sum(rate(M[R])) | rate(M[R]) | hq(0.95, rate(M_b[R])) |
| trend | rate(M[R]) | avg_over_time(M[R]) | M |
| top_n | topk(5, rate(M[R])) | topk(5, M) | topk(5, M) |
| comparison | sum by (l)(rate(M[R])) | avg by (l)(M) | hq(.95, sum by(l,le)(...)) |
| Property | Value |
|---|---|
| Total metrics (post-validation) | 1,992 |
| Domain categories | 17 |
| High-priority metrics | 350 |
| Medium-priority metrics | 1,650 |
| Keywords per metric (max) | 12 |
| GPU vendor prefixes monitored | 3 (NVIDIA, Intel, AMD) |
| Operation | Latency |
|---|---|
| Cold start (catalog load from JSON) | 15 ms |
| Cached catalog access (singleton) | 0.05 ms |
| Category filtering | 3–5 ms |
| GPU discovery (async, background) | 1–2 s |
| Catalog validation (async, background) | 1–2 s |
| Smart metric discovery (catalog path) | 1.1 s |
| Aspect | PromCopilot | Our Framework |
|---|---|---|
| Knowledge source | Knowledge graph (manually constructed) | Hybrid catalog (static + runtime discovery) |
| Setup overhead | Requires KG construction per system | Zero-config; catalog bundled, validated at startup |
| Time range handling | Not addressed | Multi-priority NL temporal resolution |
| Hardware support | General cloud metrics | Multi-vendor GPU discovery (NVIDIA, Intel, AMD) + vLLM inference metrics |
| LLM providers | GPT-4 only | 4 providers via MCP |
| Query generation | LLM + KG reasoning | Intent-driven templates with post-processing repair |
Time Series QA
Time-series question answering connects natural-language questions to evidence and reasoning over sequential data.
See all 32 papers