推出 Lightstep UQL 至 PromQL 转换器

The Sunset of Lightstep and the Migration Challenge

Lightstep 的落幕与迁移挑战

Lightstep is sunsetting. For teams that built their observability infrastructure around it, this means migrating thousands of telemetry queries, dashboards, and alerts to a new backend. At Zalando, we faced exactly this problem when transitioning to Dash0, our new PromQL-based telemetry vendor.

Lightstep 正在逐步淘汰。对于围绕它构建可观测性基础设施的团队来说,这意味着需要将数千个遥测查询、仪表板和警报迁移到新的后端。在 Zalando,当我们过渡到新的基于 PromQL 的遥测供应商 Dash0 时,就面临着完全相同的问题。

The task is straightforward but challenging: rewriting UQL (Unified Query Language) queries into PromQL. Doing this manually is slow and error-prone. Even with LLMs, the translations are unpredictable and often produce subtle bugs that break production alerts. When you're dealing with thousands of queries that monitor critical systems, you need automation that produces correct and consistent results.

这项任务直接明了但充满挑战:将 UQL(统一查询语言)查询重写为 PromQL。手动执行此操作既缓慢又容易出错。即使使用 LLM,翻译结果也难以预测,并且经常产生破坏生产环境告警的隐蔽 bug。当您处理数千个监控关键系统的查询时,您需要能够产生正确且一致结果的自动化工具。

Introducing the Lightstep UQL to PromQL Translator

介绍 Lightstep UQL 到 PromQL 的转换器

To solve this, I built a production-ready translator that converts Lightstep UQL queries to PromQL. The tool is written in Go and designed to be used in two ways: as a library (SDK) for translation in your own code, and as an HTTP server with a Web UI for interactive ad-hoc translation.

为了解决这个问题,我构建了一个生产就绪的转换器,可将 Lightstep UQL 查询转换为 PromQL。该工具使用 Go 编写,并设计为两种使用方式:作为库(SDK)在您自己的代码中进行转换,以及作为带有 Web UI 的 HTTP 服务器进行交互式临时转换。

The translator implements a full parsing pipeline: a lexer tokenizes UQL queries, a parser builds an abstract syntax tree (AST), an optimizer applies transformations to simplify the query structure, and finally the translator generates clean PromQL output.

该转换器实现了一个完整的解析管道:lexer 对 UQL 查询进行分词,parser 构建抽象语法树(AST),optimizer 应用转换以简化查询结构,最后转换器生成规范的 PromQL 输出。

The project is available at github.com/zalando/lightstep-uql-to-promql-translator.

该项目可在 github.com/zalando/lightstep-uql-to-promql-translator 获取。

How to Use the...

开通本站会员,查看完整译文。

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-03 01:10
浙ICP备14020137号-1 $mapa de visitantes$