让工程师用自然语言查询云原生监控数据,自动转成PromQL。
From Natural Language to PromQL: A Catalog-Driven Framework with Dynamic Temporal Resolution for Cloud-Native Observability
- 基于静态+动态发现的2000+指标目录,支持跨GPU厂商信号识别。
- 多阶段管道1.1秒内完成从问句到可执行PromQL的转换。
- 支持生产环境千级指标查询,适合运维与可靠性团队使用。
现代云原生平台通过Prometheus等系统暴露数千个时间序列指标,但使用PromQL等领域专用语言编写正确查询对平台工程师和运维团队仍是重大挑战。本文提出一种基于指标目录的框架,将自然语言问题转化为可执行的PromQL查询,弥合人类意图与可观测性数据之间的差距。该方法包含三项贡献:(1) 混合指标目录,整合约2000个静态编排的基础指标与跨GPU厂商的运行时硬件信号发现;(2) 多阶段查询流水线,包括意图分类、类别感知指标路由和多维语义评分;(3) 动态时间分辨率机制,能解析多样化的自然语言时间表达,并映射为合适的PromQL时间语法。框架集成至Model Context Protocol (MCP),实现跨多供应商的工具增强型LLM交互。基于目录的方案通过预计算类别索引实现亚秒级指标发现,全链路处理耗时约1.1秒。系统已部署于管理AI推理负载的生产级Kubernetes集群,支持对约2000个指标(涵盖集群健康、GPU利用率、模型服务性能)的自然语言查询。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。