发布日期: 2025-07-11
版本号: v3.5.0-rc.1

Prometheus 3.5是一个长期支持(LTS)版本,包含众多新功能且无已知破坏性变更。新特性主要涉及PromQL实验性功能、抓取配置优化、OTLP指标属性提升以及STACKIT Cloud服务发现支持等。同时,移除了RC.1版本中因问题被废弃的OTLP作用域元数据提升功能。此版本在UI、PromQL、规则检查及抓取等方面进行了多项增强,并在PromQL、UI、Kubernetes服务发现、TSDB存储等多处性能优化。此外,修复了涉及PromQL直方图处理、UI显示、API安全、远程写认证及抓取等多个模块的错误,提升了整体稳定性。

更新内容 (中文)

3.5 将是一个长期支持(LTS)版本;详见发布周期说明 https://prometheus.io/docs/introduction/release-cycle/ 本版本包含多项新功能,且无已知的破坏性变更。

以下功能自 RC.1 后因发现问题被移除:

  • [特性] OTLP:支持通过 otlp.promote_scope_metadata 将 OTel 作用域名称/版本/模式URL/属性提升为指标标签。 #16730 #16760

变更内容

  • [特性] 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:可选择使用直接 IO 写入块。 #15365
  • [性能] TSDB:获取标签值时,若达到限制则提前停止工作。 #16158
  • [性能] 标签:更简单/更快的 stringlabels 编码。 #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 will be 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.

The following feature was removed since RC.1, since problems were discovered:

  • [FEATURE] OTLP: Support promoting OTel scope name/version/schema URL/attributes as metric labels, via otlp.promote_scope_metadata. #16730 #16760

What’s Changed

  • [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

下载链接