发布日期: 2025-08-23
版本号: v3.6.0-rc.0

本次更新包含多项新功能、性能优化及问题修复。新功能方面,为PromQL添加了step()以及持续时间的min()max()函数(需启用promql-duration-expr特性标志),新增了获取TSDB块元数据的API端点,并在模板中增加了toDuration()now()函数。增强功能包括为发现机制支持附加命名空间元数据,为OTLP协议增加多种翻译策略和元数据处理选项,在追踪中发送traceparent头,以及改进了UI的元数据处理和查询消息设置。性能上,通过内部优化提升了PromQL查询速度。修复内容涉及多个方面:解决了配置验证、发现关闭时的竞态条件、OTLP目标信息采样生成、PromQL函数在处理NaN值及原生直方图时的多种问题,包括外推计算、数值误差、子查询一致性和注解标注,还修复了抓取时的内存损坏以及TSDB在特定特性标志下的追加异常。

更新内容 (中文)

  • [功能特性] PromQL: 新增 step() 函数以及对持续时间的 min()max() 函数,需通过功能标志 promql-duration-expr 启用。#16777
  • [功能特性] API: 新增 /v1/status/tsdb/blocks 端点,用于公开已加载数据块的元数据。#16695
  • [功能特性] 模板: 新增 toDuration()now() 函数。#16619
  • [增强功能] 服务发现: 支持将命名空间元数据附加到目标。#16831
  • [增强功能] OTLP: 通过 otlp.translation_strategy 支持新的 UnderscorEscapingWithoutSuffixes 策略。#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
  • [性能优化] PromQL: 通过内部优化提升性能。#16797
  • [错误修复] 配置: 修复配置验证时产生的 “unknown global name escaping method” 错误消息。#16801
  • [错误修复] 服务发现: 修复关闭时的竞争条件。#16820
  • [错误修复] OTLP: 在每个资源的最早和最晚采样点之间生成 target_info 样本。#16737
  • [错误修复] PromQL: 当 topk()bottomk()limitk()limit_ratio() 的参数传入 NaN 时现在会失败。#16725
  • [错误修复] PromQL: 修复原生计数器直方图的外推问题。#16828
  • [错误修复] PromQL: 通过禁用某些优化减少数值误差。#16895
  • [错误修复] PromQL: 修复子查询中使用原生直方图时的不一致问题。#16879
  • [错误修复] PromQL: 当功能标志 type-and-unit-labels 启用时,修复直方图 rate()increase() 的注释不一致问题。#16915
  • [错误修复] 抓取: 修复 slicelabels 构建中的内存损坏问题。#16946
  • [错误修复] TSDB: 当功能标志 created-timestamp-zero-ingestion 启用时,修复追加操作导致的崩溃。#16332
  • [错误修复] TSDB: 修复追加空桶的原生直方图时导致的崩溃。#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
  • [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

下载链接