发布日期: 2025-09-22
版本号: v3.6.0

Prometheus 此次更新为 PromQL 增加了 step()min()max() 等新函数,API 新增了用于暴露加载块元数据的端点,模板中加入了 toDuration()now() 函数。在功能增强方面,发现机制支持附加命名空间元数据,OTLP 支持新的下划线转义策略、将 scope 元数据提升为标签以及添加类型与单位标签,追踪功能会在抓取时发送 traceparent 头,UI 增加了禁用查询消息的选项并改进了元数据处理,TSDB 通过新指标跟踪陈旧序列。性能上对 PromQL 进行了内部优化。同时修复了多项问题,包括配置验证的错误信息、发现机制的竞态条件、OTLP 的样本生成、PromQL 多个边界情况(如 NaN 参数、原生直方图外推、子查询不一致等),以及抓取和 TSDB 中的内存与空桶相关 panic 问题。

更新内容 (中文)

  • [功能] PromQL:添加 step(),以及针对持续时间的 min()max(),由功能标志 promql-duration-expr 启用。#16777
  • [功能] API:添加 /v1/status/tsdb/blocks 端点,公开已加载块的元数据。#16695
  • [功能] 模板:添加 toDuration()now() 函数。#16619
  • [增强] 发现:添加支持将命名空间元数据附加到目标。#16831
  • [增强] OTLP:通过 otlp.translation_strategy 支持新的 UnderscoreEscapingWithoutSuffixes 策略。#16849
  • [增强] OTLP:通过 otlp.promote_scope_metadata 支持将范围元数据包含为指标标签。#16878
  • [增强] OTLP:当功能标志 type-and-unit-labels 启用时,添加 __type____unit__ 标签。#16630
  • [增强] 追踪:在抓取期间发送 traceparent HTTP 头。#16425
  • [增强] UI:在 查询页面设置 下添加禁用信息和警告查询消息的选项。#16901
  • [增强] UI:改进 _count/_sum/_bucket 后缀的元数据处理。#16910
  • [增强] TSDB:通过 prometheus_tsdb_head_stale_series 指标跟踪 Head 块中的陈旧序列。#16925
  • [性能] PromQL:由于内部优化,性能提升。#16797
  • [修复] 配置:修复配置验证期间产生的“未知全局名称转义方法”错误消息。#16801
  • [修复] 发现:修复关闭期间的竞态条件。#16820
  • [修复] OTLP:在每个资源的最早和最晚样本之间生成 target_info 样本。#16737
  • [修复] PromQL:当 NaN 作为参数传递给 topk()bottomk()limitk()limit_ratio() 时失败。#16725
  • [修复] PromQL:修复原生计数器直方图的外推问题。#16828
  • [修复] PromQL:通过禁用一些优化来减少数值错误。#16895
  • [修复] PromQL:修复在子查询中使用原生直方图时的不一致问题。#16879
  • [修复] PromQL:当功能标志 type-and-unit-labels 启用时,修复直方图上 rate()increase() 的不一致注释。#16915
  • [修复] 抓取:修复 slicelabels 构建中的内存损坏问题。#16946
  • [修复] TSDB:当功能标志 created-timestamp-zero-ingestion 启用时,修复追加时的 panic 问题。#16332
  • [修复] TSDB:修复带有空桶的原生直方图追加时的 panic 问题。#16893

更新内容 (原始)

  • [FEATURE] PromQL: Add step(), and min() and max() on durations, behind feature flag promql-duration-expr. #16777
  • [FEATURE] API: Add a /v1/status/tsdb/blocks endpoint exposing metadata about loaded blocks. #16695
  • [FEATURE] Templates: Add toDuration() and now() functions. #16619
  • [ENHANCEMENT] Discovery: Add support for attaching namespace metadata to targets. #16831
  • [ENHANCEMENT] OTLP: Support new UnderscoreEscapingWithoutSuffixes strategy via otlp.translation_strategy. #16849
  • [ENHANCEMENT] OTLP: Support including scope metadata as metric labels via otlp.promote_scope_metadata. #16878
  • [ENHANCEMENT] OTLP: Add __type__ and __unit__ labels when feature flag type-and-unit-labels is enabled. #16630
  • [ENHANCEMENT] Tracing: Send the traceparent HTTP header during scrapes. #16425
  • [ENHANCEMENT] UI: Add option to disable info and warning query messages under Query page settings. #16901
  • [ENHANCEMENT] UI: Improve metadata handling for _count/_sum/_bucket suffixes. #16910
  • [ENHANCEMENT] TSDB: Track stale series in the Head block via the prometheus_tsdb_head_stale_series metric. #16925
  • [PERF] PromQL: Improve performance due to internal optimizations. #16797
  • [BUGFIX] Config: Fix “unknown global name escaping method” error messages produced during config validation. #16801
  • [BUGFIX] Discovery: Fix race condition during shutdown. #16820
  • [BUGFIX] OTLP: Generate target_info samples between the earliest and latest samples per resource. #16737
  • [BUGFIX] PromQL: Fail when NaN is passed as parameter to topk(), bottomk(), limitk() and limit_ratio(). #16725
  • [BUGFIX] PromQL: Fix extrapolation for native counter histograms. #16828
  • [BUGFIX] PromQL: Reduce numerical errors by disabling some optimizations. #16895
  • [BUGFIX] PromQL: Fix inconsistencies when using native histograms in subqueries. #16879
  • [BUGFIX] PromQL: Fix inconsistent annotations for rate() and increase() on histograms when feature flag type-and-unit-labels is enabled. #16915
  • [BUGFIX] Scraping: Fix memory corruption in slicelabels builds. #16946
  • [BUGFIX] TSDB: Fix panic on append when feature flag created-timestamp-zero-ingestion is enabled. #16332
  • [BUGFIX] TSDB: Fix panic on append for native histograms with empty buckets. #16893

下载链接