发布日期: 2026-05-19
版本号: v3.12.0-rc.0

本次发布包含安全修复、新功能(主要涉及PromQL和服务发现)、TSDB性能改进、起始时间戳优化及大量错误修复。安全方面修复了远程写入的拒绝服务漏洞和STACKIT服务发现的密钥泄露问题。PromQL新增了start()end()等实验函数,并改进了rate()等函数对起始时间戳的支持。TSDB优化了头部块查询性能并降低了CPU使用率。服务发现新增了DigitalOcean托管数据库和Outscale VM支持,并改进了AWS服务发现的IPv6兼容性。此外还包含众多其他功能增强和错误修复。

更新内容 (中文)

本版本包含安全修复、新功能(尤其是围绕 PromQL 和服务发现)、TSDB 性能改进、起始时间戳改进以及众多错误修复。

感谢所有贡献者!

关键亮点

  • 安全性:修复了两个安全漏洞:远程写入中的拒绝服务攻击(snappy 解压限制)和 STACKIT 服务发现中的密钥泄露。
  • PromQL 与元数据:多项与实验性"起始时间戳"支持相关的功能和错误修复,包括更新 rate()irate()increase()resets()。引入了新的实验性函数 start()end()range()step()
  • TSDB 性能:优化了头部块查找(常数时间)和 mmap 操作,以减少 CPU 使用率。
  • 服务发现:新增对 DigitalOcean 托管数据库和 Outscale 虚拟机的支持,同时改进了 AWS SD(EC2 的 IPv6 支持、外部 ID 支持)。
  • 用户界面:新增用于删除时间序列和清理墓碑标记的 Web 界面。

更新日志

  • [安全] 远程写入:拒绝通过远程写入接收的 snappy 压缩请求,当其声明的解码长度超过 32MB 时。感谢 @hibrian827 报告此问题。#18642
  • [安全] STACKIT SD:修复通过 /-/config 端点以明文形式暴露的密钥问题。感谢 @August829 和 @Phaxma 报告。GHSA-39j6-789q-qxvh #18649
  • [变更] TSDB/Agent:为所有内存中的 WAL 直方图样本添加起始时间戳字段;使用 st-storage 标志时启用。#18221
  • [功能] API:添加 /api/v1/status/self_metrics 端点,以 JSON 格式返回 Prometheus 服务器自身指标的当前状态。#18411
  • [功能] 服务发现:添加 DigitalOcean 托管数据库服务发现 #18287
  • [功能] Prometheus:添加对 aix/ppc64 编译目标的支持 #18321
  • [功能] 服务发现:添加 Outscale 虚拟机服务发现(outscale_sd_configs),用于从 Outscale 云 API 发现抓取目标。#18139
  • [功能] PromQL:当在范围(矩阵)查询中使用 sortsort_by_labelsort_by_label_desc 时发出警告,因为这些函数在此上下文中无效。#18498
  • [功能] PromQL:添加实验性函数 start()end()range()step() #17877
  • [功能] PromQL:更新 resets() 函数以考虑起始时间戳重置。在 use-start-timestamps 功能标志后隐藏。#18627
  • [功能] Prometheus:将自动重载配置提升为稳定功能 #18620
  • [功能] TSDB/Agent:为 agent.DB 添加 CheckpointFromInMemorySeries 选项,支持基于内存中的序列进行检查点。#17948
  • [功能] 用户界面:新增用于删除时间序列和清理墓碑标记的 Web 界面,可从"状态"菜单访问。#18390
  • [功能] PromQL:使用起始时间戳进行 rate()irate()increase() 计算,受功能标志 use-start-timestamps 控制。不与扩展范围选择器 anchoredsmoothed 一起使用。#18344
  • [功能] 抓取:添加功能标志 st-synthesis,为抓取的累积指标合成未知的起始时间戳。在使用增量或基于 OpenTelemetry 的后端进行远程写入 2.0 时有用。#18279
  • [功能] promqltest:支持在 load 块中使用 @st 注解,以指定每个样本的起始时间戳。#18360
  • [增强] API:拒绝并发的 fgprof 性能分析。#18651
  • [增强] AWS SD:为 ECS/MSK/RDS/Elasticache 添加可选的 external_id 字段。#18579
  • [增强] AWS SD:添加可选的 external_id 字段。#17171
  • [增强] 服务发现:通过引入动态退避间隔(而非静态 5 秒间隔)来加速服务发现目标更新的传播。#18187
  • [增强] Promtool:为 query instant 命令添加 --header 标志,与现有的 query range 行为匹配。#18418
  • [增强] AWS SD:允许 EC2 服务发现 IPv6 地址以与目标端点通信。当同时存在 IPv4 和 IPv6 地址时,私有 IPv4 地址仍为默认值。#16088
  • [性能] TSDB:使范围查询中的头部块查找从二次时间复杂度变为常数时间 #18302
  • [性能] TSDB:当无需对任何序列进行 mmap 时,跳过 mmapHeadChunks 中的整个条带,在生产相关规模下显著降低 CPU 利用率。#18541
  • [性能] TSDB:在周期性头部块 mmap 期间,使用缓存的头部块计数跳过干净的序列 #18272
  • [性能] PromQL:解决 Go 1.26 上 FloatHistogram.KahanAdd 的性能回归问题。#18568
  • [错误修复] PromQL:修复 info() 函数错误处理否定的 __name__ 匹配器的问题 #17932
  • [错误修复] API:在 /parse_ast 中返回持续时间表达式。#18624
  • [错误修复] API:在 OpenAPI 规范中正确记录持续时间查询请求参数(步长、超时和回溯间隔)接受的格式 #18305
  • [错误修复] 抓取:AppenderV2 现在即使在 OOO/重复序列错误发生时也能跟踪陈旧性,与 AppenderV1 类似 #18567
  • [错误修复] 配置:在加载时验证 remote_write queue_config 字段,以防止运行时 panic 和静默配置错误。#18209
  • [错误修复] 服务发现/Consul:添加用于健康 API 过滤的 health_filter,修复了在 filter 中使用仅限目录的字段(如 ServiceTags)时出现的故障。#18479 #18499
  • [错误修复] OTLP:限制 gzip 编码的 OTLP 写入请求的解压后正文大小。#18408
  • [错误修复] PromQL:修复当所有数据严格在查询范围之后时,smoothed 的 rate/increase 返回零而不是无结果的问题。#18523
  • [错误修复] PromQL:修复当对包含丢弃名称的函数(如 abs())的子查询应用 last_over_time 或 first_over_time 时,指标名称未被丢弃的问题。#18409
  • [错误修复] PromQL:修复在统计查询中混合指数和自定义存储桶直方图时缺少警告的问题。#18660
  • [错误修复] PromQL:修复持续时间表达式中 range() 关键字(如 foo[5m+range()])的解析问题。#18623
  • [错误修复] PromQL:修复当使用 @ 修饰符时,平滑向量选择器在二进制操作中返回无结果的问题。#18531
  • [错误修复] PromQL:拒绝 NaN、无穷大和超出范围的持续时间表达式,而不是静默产生超出范围的 time.Duration。#18639
  • [错误修复] 抓取:修复抓取格式错误的原生直方图时发生的 panic 问题。#18414
  • [错误修复] 抓取:修复通过 protobuf 格式抓取暴露无分位数摘要的 target 时发生的 panic 问题。#18382
  • [错误修复] 抓取:修复配置重新加载后偶尔未应用抓取失败日志文件的问题。#18421
  • [错误修复] TSDB:允许使用新数据路径的保留百分比。#18628
  • [错误修复] TSDB:在基于百分比的保留策略中保持十进制精度 #18374
  • [错误修复] TSDB:修复 WAL 重放后 prometheus_tsdb_head_chunks 变为负值的问题 #18401
  • [错误修复] TSDB:在查询重叠的块时,原生直方图导致的 panic 问题。#18692
  • [错误修复] 跟踪:修复不安全的 OTLP HTTP 跟踪的启动失败问题 #18469
  • [错误修复] 用户界面:转义 PromQL 自动补全提供的标签值。#18658
  • [错误修复] 用户界面:改进小范围内图形值的 Y 轴刻度标签精度。#18682
  • [错误修复] 当抓取作业被删除时,特定抓取作业的 prometheus_sd_refresh*prometheus_sd_discovered_targets 指标被删除。#17614
  • [错误修复] 远程写入:修复解析元数据单位符号时对接收到的 RW2 请求的验证。修复了请求会导致(已恢复的)处理程序 panic 的情况。#18641
  • [错误修复] TSDB/Agent:修复代理追加器中的竞态条件,该条件下对相同标签集的并发追加可能产生重复的内存中序列和重复的 WAL 记录。#18292
  • [错误修复] 配置:更新 --enable-feature 标志描述并按字母排序功能名称。#18487

更新内容 (原始)

This release contains security fixes, new features (especially around PromQL and Service Discovery), performance improvements in TSDB, Start Timestamp improvements and numerous bug fixes.

Thanks to all contributors!

Key Highlights

  • Security: Two security vulnerabilities have been addressed: a denial of service in remote-write (snappy decompression limit) and a secret exposure leak in STACKIT service discovery.
  • PromQL & Metadata: Several features and bug fixes related to the experimental “start timestamps” support, including updates to rate(), irate(), increase(), and resets(). New experimental functions start(), end(), range(), and step() are introduced.
  • TSDB Performance: Optimizations in head chunk lookup (constant time) and mmap operations to reduce CPU usage.
  • Service Discovery: Added support for DigitalOcean Managed Databases and Outscale VM, along with improvements to AWS SD (IPv6 support for EC2, external ID support).
  • UI: Added a web interface for deleting time series and cleaning tombstones.

Changelog

  • [SECURITY] Remote: Reject snappy-compressed received requests via Remote Write whose declared decoded length exceeds the 32MB. Thanks to @hibrian827 for reporting it. #18642
  • [SECURITY] STACKIT SD: Fix secrets being exposed in plaintext via /-/config endpoint. Thanks to @August829 and @Phaxma for reporting. GHSA-39j6-789q-qxvh #18649
  • [CHANGE] TSDB/Agent: Adds Start Timestamp field to all WAL Histogram samples in memory; used st-storage flag is enabled. #18221
  • [FEATURE] API: Add /api/v1/status/self_metrics endpoint returning the current state of the Prometheus server’s own metrics about itself as JSON. #18411
  • [FEATURE] Discovery: Add DigitalOcean Managed Databases service discovery #18287
  • [FEATURE] Prometheus: Add support for the aix/ppc64 compilation target #18321
  • [FEATURE] Discovery: Add Outscale VM service discovery (outscale_sd_configs) for discovering scrape targets from the Outscale Cloud API. #18139
  • [FEATURE] PromQL: Emit a warning when sort, sort_by_label or sort_by_label_desc is used within range (matrix) queries, as these functions do not have effect in that context. #18498
  • [FEATURE] PromQL: Add start(), end(), range(), and step() experimental functions #17877
  • [FEATURE] PromQL: Update resets() function to consider start timestamp resets. Hidden behind use-start-timestamps feature flag. #18627
  • [FEATURE] Prometheus: Promote auto-reload-config as stable #18620
  • [FEATURE] TSDB/Agent: Add CheckpointFromInMemorySeries option to agent.DB that enables checkpoint based on in-memory series. #17948
  • [FEATURE] UI: Add a web interface for deleting time series and cleaning tombstones, accessible from the Status menu. #18390
  • [FEATURE] PromQL: Use start timestamps for rate(), irate(), and increase() calculations, behind a feature flag use-start-timestamps. Doesn’t work together with extended range selectors anchored and smoothed. #18344
  • [FEATURE] Scrape: Added a feature flag st-synthesis which synthesizes unknown STs for scraped cumulative metrics. Useful when Remote Writing 2.0 with delta or Otel-based backends. #18279
  • [FEATURE] promqltest: support @st annotation in load blocks to specify per-sample start timestamps. #18360
  • [ENHANCEMENT] API: reject concurrent fgprof profiles. #18651
  • [ENHANCEMENT] AWS SD: Add optional external_id field to ECS/MSK/RDS/Elasticache. #18579
  • [ENHANCEMENT] AWS SD: Add optional external_id field. #17171
  • [ENHANCEMENT] Discovery: Propagate SD target updates faster by introducing dynamic backoff interval instead of static 5s interval for throttling. #18187
  • [ENHANCEMENT] Promtool: Add --header flag to query instant command, matching existing query range behaviour. #18418
  • [ENHANCEMENT]: AWS SD: Allows EC2 service discovery to discover IPv6 addresses to communicate with target endpoints. The private IPv4 address remains the default when both IPv4 and IPv6 addresses are present. #16088
  • [PERF] TSDB: Make head chunk lookup in range queries constant time instead of quadratic time #18302
  • [PERF] TSDB: Skip entire stripes in mmapHeadChunks when no series need mmapping, reducing CPU utilization significantly at production-relevant scales. #18541
  • [PERF] TSDB: Skip clean series during periodic head chunk mmap using cached head chunk count #18272
  • [PERF] PromQL: Address FloatHistogram.KahanAdd performance regression on Go 1.26. #18568
  • [BUGFIX] PromQL: Fix info() function incorrectly handling negated __name__ matchers #17932
  • [BUGFIX] API: Return duration expressions in /parse_ast. #18624
  • [BUGFIX] API: correctly document formats accepted for duration query request parameters (step, timeout and lookback delta) in OpenAPI spec #18305
  • [BUGFIX] Scrape: AppenderV2 now tracks staleness even when OOO/duplicate series errors happen similar to AppenderV1 #18567
  • [BUGFIX] Config: Validate remote_write queue_config fields at load time to prevent runtime panic and silent misconfiguration. #18209
  • [BUGFIX] Discovery/Consul: Add health_filter for Health API filtering, fixing breakage when using Catalog-only fields like ServiceTags in filter. #18479 #18499
  • [BUGFIX] OTLP: limit decompressed body size for gzip-encoded OTLP write requests. #18408
  • [BUGFIX] PromQL: Fix smoothed rate/increase returning zero instead of no result when all data falls strictly after the query range. #18523
  • [BUGFIX] PromQL: Fix metric name not being dropped when last_over_time or first_over_time is applied to subqueries containing name-dropping functions like abs(). #18409
  • [BUGFIX] PromQL: Fix missing warning when mixing exponential and custom-bucket histograms in stats queries. #18660
  • [BUGFIX] PromQL: Fix parsing of range() keyword in duration expressions such as foo[5m+range()]. #18623
  • [BUGFIX] PromQL: Fix smoothed vector selector returning no results in binary operations when the @ modifier is used. #18531
  • [BUGFIX] PromQL: Reject NaN, infinite, and out-of-range duration expressions instead of silently producing an out-of-range time.Duration. #18639
  • [BUGFIX] Scrape: Fix panic when scraping malformed native histograms. #18414
  • [BUGFIX] Scrape: fix panic when scraping a target exposing a summary with no quantiles via the protobuf format. #18382
  • [BUGFIX] Scrape: fix scrape failure log file occasionally not applied after a configuration reload. #18421
  • [BUGFIX] TSDB: Allow retention percentage with new data path. #18628
  • [BUGFIX] TSDB: Preserve decimal precision in percentage-based retention #18374
  • [BUGFIX] TSDB: fix prometheus_tsdb_head_chunks going negative after WAL replay #18401
  • [BUGFIX] TSDB: panic with native histograms during query of overlapping chunks. #18692
  • [BUGFIX] Tracing: fix startup failure for insecure OTLP HTTP tracing #18469
  • [BUGFIX] UI: Escape label values offered by PromQL autocomplete. #18658
  • [BUGFIX] UI: Improve Y-axis tick label precision for graph values over small ranges. #18682
  • [BUGFIX] prometheus_sd_refresh* and prometheus_sd_discovered_targets metrics for specific scrape jobs are deleted when the scrape job is removed. #17614
  • [BUGFIX] Remote: fixed validation for received RW2 requests when parsing metadata unit symbols. This fixes a case when request would cause (recovered) handler panic. #18641
  • [BUGFIX] TSDB/Agent: fix race in agent appender where concurrent appends for the same label set could produce duplicate in-memory series and duplicate WAL records. #18292
  • [BUGFIX] Config: Update --enable-feature flag description and sort feature names. #18487

下载链接