发布日期: 2025-07-14
版本号: v3.5.0

Prometheus 3.5 是一个长期支持(LTS)版本,引入了多项新功能、性能优化和错误修复。新功能包括实验性的 PromQL 类型与单位元数据标签、新增的时间函数、抓取配置选项以及新的服务发现支持。性能方面,优化了 UI 渲染、PromQL 执行、抓取并发和 TSDB 存储等。修复了众多关键问题,特别是关于原生直方图处理、聚合计算、NaN 值、UI 显示和配置解析等方面的错误,提升了系统的稳定性和数据准确性。

更新内容 (中文)

3.5是长期支持(LTS)版本;请参阅发布周期文档 https://prometheus.io/docs/introduction/release-cycle/ 本次版本包含多项新功能,且无已知的破坏性变更:

  • [功能] PromQL:新增实验性类型和单位元数据标签,需通过功能开关 type-and-unit-labels 启用。 #16228 #16632 #16718 #16743
  • [功能] PromQL:新增 ts_of_(min|max|last)_over_time 函数,需通过功能开关 experimental-promql-functions 启用。 #16722 #16733
  • [功能] 数据采集:新增全局选项 always_scrape_classic_histograms,即使经典直方图同时以原生格式暴露,也对其进行采集。 #16452
  • [功能] OTLP:新增配置选项 promote_all_resource_attributesignore_resource_attributes。 #16426
  • [功能] 服务发现:新增对 STACKIT Cloud 的服务发现支持。 #16401
  • [改进] Hetzner SD:新增 label_selector 以过滤服务器。 #16512
  • [改进] PromQL:在 quantiletopk 等聚合操作中支持非常量参数。 #16404
  • [改进] UI:在使用 keep_dropped_targets 选项时,优化总目标数的显示。 #16604
  • [改进] UI:在 /rules 页面添加简单过滤功能。 #16605
  • [改进] UI:在表格查询标签页的悬停提示中显示查询统计信息。 #16723
  • [改进] UI:在 /targets 页面清空搜索字段。 #16567
  • [改进] 规则:在启动时更早检查规则解析是否出错。 #16601
  • [改进] Promtool:在规则单元测试中可选使用模糊的 float64 比较。 #16395
  • [性能] PromQL:尽可能重用 histogramStatsIterator。 #16686
  • [性能] PromQL:重用原生直方图的自定义桶值的存储。 #16565
  • [性能] UI:优化 /targets 页面的备忘录和搜索防抖。 #16589
  • [性能] UI:修复打开状态导航菜单时的全页面重新渲染问题。 #16590
  • [性能] Kubernetes SD:使用服务 cache.Indexer 以获得更好性能。 #16365
  • [性能] TSDB:可选使用直接 I/O 进行数据块写入。 #15365
  • [性能] TSDB:获取标签值时,若达到限制则更早停止工作。 #16158
  • [性能] 标签:采用更简单/更快的字符串标签编码。 #16069
  • [性能] 数据采集:并发重载采集池。 #16595 #16783
  • [错误修复] 顶层:在加载 TSDB 之前更新 GOGC。 #16491
  • [错误修复] 配置:若不存在 “runtime” 块,则遵循 GOGC 环境变量。 #16558
  • [错误修复] PromQL:修复原生直方图的 last_over_time 函数。 #16744
  • [错误修复] PromQL:修复聚合操作包装在 ParenExpr 中时,错误报告的解析器位置范围问题。 #16041 #16754
  • [错误修复] PromQL:当同一时间戳同时存在经典和原生直方图时,histogram_fractionhistogram_quantile 不再发出值。 #16552
  • [错误修复] PromQL[1001ms] 错误舍入为 [1s] 等类似问题。 #16478
  • [错误修复] PromQL:修复不一致/有时为负值的 histogram_counthistogram_sum。 #16682
  • [错误修复] PromQL:改进原生直方图中 NaN 的处理。 #16724
  • [错误修复] PromQL:修复持续时间表达式中一元运算符的优先级。 #16713
  • [错误修复] PromQL:提高 avg 聚合和 avg_over_time 的一致性。 #16569 #16773
  • [错误修复] UI:在图形视图中添加查询警告和信息。 #16753 #16759
  • [错误修复] API:在响应中添加 HTTP Vary: Origin 头以避免缓存中毒。 #16008
  • [错误修复] 服务发现:通过按一致顺序获取锁来避免死锁。 #16587
  • [错误修复] 远程写入:对于 Azure AD 认证,允许空的 client_id 以支持系统分配的托管标识。 #16421
  • [错误修复] 数据采集:修复罕见的内存损坏错误。 #16623
  • [错误修复] 数据采集:在遇到指数直方图后继续处理自定义桶直方图。 #16720
  • [错误修复] OTLP:当未设置 otlp: 块时,未遵循默认配置。 #16693

更新内容 (原始)

3.5 is a Long Term Support (LTS) release; see release https://prometheus.io/docs/introduction/release-cycle/ There are a number of new features, and no known breaking changes in this release:

  • [FEATURE] PromQL: Add experimental type and unit metadata labels, behind feature flag type-and-unit-labels. #16228 #16632 #16718 #16743
  • [FEATURE] PromQL: Add ts_of_(min|max|last)_over_time, behind feature flag experimental-promql-functions. #16722 #16733
  • [FEATURE] Scraping: Add global option always_scrape_classic_histograms to scrape a classic histogram even if it is also exposed as native. #16452
  • [FEATURE] OTLP: New config options promote_all_resource_attributes and ignore_resource_attributes. #16426
  • [FEATURE] Discovery: New service discovery for STACKIT Cloud. #16401
  • [ENHANCEMENT] Hetzner SD: Add label_selector to filter servers. #16512
  • [ENHANCEMENT] PromQL: support non-constant parameter in aggregations like quantile and topk. #16404
  • [ENHANCEMENT] UI: Better total target count display when using keep_dropped_targets option. #16604
  • [ENHANCEMENT] UI: Add simple filtering on the /rules page. #16605
  • [ENHANCEMENT] UI: Display query stats in hover tooltip over table query tab. #16723
  • [ENHANCEMENT] UI: Clear search field on /targets page. #16567
  • [ENHANCEMENT] Rules: Check that rules parse without error earlier at startup. #16601
  • [ENHANCEMENT] Promtool: Optional fuzzy float64 comparison in rules unittests. #16395
  • [PERF] PromQL: Reuse histogramStatsIterator where possible. #16686
  • [PERF] PromQL: Reuse storage for custom bucket values for native histograms. #16565
  • [PERF] UI: Optimize memoization and search debouncing on /targets page. #16589
  • [PERF] UI: Fix full-page re-rendering when opening status nav menu. #16590
  • [PERF] Kubernetes SD: use service cache.Indexer to achieve better performance. #16365
  • [PERF] TSDB: Optionally use Direct IO for chunks writing. #15365
  • [PERF] TSDB: When fetching label values, stop work earlier if the limit is reached. #16158
  • [PERF] Labels: Simpler/faster stringlabels encoding. #16069
  • [PERF] Scraping: Reload scrape pools concurrently. #16595 #16783
  • [BUGFIX] Top-level: Update GOGC before loading TSDB. #16491
  • [BUGFIX] Config: Respect GOGC environment variable if no “runtime” block exists. #16558
  • [BUGFIX] PromQL: Fix native histogram last_over_time. #16744
  • [BUGFIX] PromQL: Fix reported parser position range in errors for aggregations wrapped in ParenExpr #16041 #16754
  • [BUGFIX] PromQL: Don’t emit a value from histogram_fraction or histogram_quantile if classic and native histograms are present at the same timestamp. #16552
  • [BUGFIX] PromQL: Incorrect rounding of [1001ms] to [1s] and similar. #16478
  • [BUGFIX] PromQL: Fix inconsistent / sometimes negative histogram_count and histogram_sum. #16682
  • [BUGFIX] PromQL: Improve handling of NaNs in native histograms. #16724
  • [BUGFIX] PromQL: Fix unary operator precedence in duration expressions. #16713
  • [BUGFIX] PromQL: Improve consistency of avg aggregation and avg_over_time. #16569 #16773
  • [BUGFIX] UI: Add query warnings and info to graph view. #16753 #16759
  • [BUGFIX] API: Add HTTP Vary: Origin header to responses to avoid cache poisoning. #16008
  • [BUGFIX] Discovery: Avoid deadlocks by taking locks in consistent order. #16587
  • [BUGFIX] Remote-write: For Azure AD auth, allow empty client_id to suppport system assigned managed identity. #16421
  • [BUGFIX] Scraping: Fix rare memory corruption bug. #16623
  • [BUGFIX] Scraping: continue handling custom-bucket histograms after an exponential histogram is encountered. #16720
  • [BUGFIX] OTLP: Default config not respected when otlp: block is unset. #16693

下载链接