发布日期: 2026-05-28
版本号: v3.12.0

该版本发布包含安全修复、新功能(特别是在PromQL和云服务发现方面)、TSDB性能改进、起始时间戳功能的优化以及大量错误修复。具体要点如下:安全方面修复了远程写入中的拒绝服务漏洞和STACKIT服务发现中的密钥泄露问题;PromQL新增了实验性的起始时间戳支持功能,包括更新rate()increase()等函数并引入start()end()等新函数;TSDB通过优化头部数据块查询和内存映射操作提升了性能;服务发现新增了对DigitalOcean托管数据库和Outscale虚拟机的支持,并改进了AWS服务发现(如EC2的IPv6支持);UI界面新增了删除时间序列和清理墓碑的功能。此外还修复了包括PromQL函数处理、配置验证、抓取稳定性、TSDB数据保留及并发写入等多方面的已知问题。

更新内容 (中文)

本版本包含安全修复、新功能(特别是围绕PromQL和服务发现方面)、TSDB性能改进、起始时间戳改进及大量错误修复。

感谢所有贡献者!

核心亮点

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

更新日志

  • [安全] 远程:拒绝通过远程写入接收声明解码长度超过32MB的snappy压缩请求。感谢@hibrian827报告此问题。#18642
  • [安全] STACKIT服务发现:修复通过/-/config端点明文暴露密钥的问题。感谢@August829和@Phaxma报告。GHSA-39j6-789q-qxvh #18649
  • [变更] TSDB/代理:为所有内存中的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.DB新增CheckpointFromInMemorySeries选项,支持基于内存系列创建检查点。#17948
  • [功能] 用户界面:新增用于删除时间序列和清理墓碑记录的Web界面,可从状态菜单访问。#18390
  • [功能] PromQL:在功能标志use-start-timestamps后使用起始时间戳进行rate()irate()increase()计算。不与扩展范围选择器anchoredsmoothed同时工作。#18344
  • [功能] 抓取:新增功能标志st-synthesis,为抓取的累积指标合成未知起始时间戳。在使用Delta或OpenTelemetry后端进行远程写入2.0时有用。#18279
  • [功能] promql测试:支持在load块中使用@st注解来指定每个样本的起始时间戳。#18360
  • [改进] API:拒绝并发的fgprof性能分析请求。#18651
  • [改进] AWS服务发现:为ECS/MSK/RDS/Elasticache添加可选的external_id字段。#18579
  • [改进] AWS服务发现:添加可选的external_id字段。#17171
  • [改进] 发现:通过引入动态退避间隔替代静态5秒限流间隔,加快服务发现目标更新传播。#18187
  • [改进] Promtool:为query instant命令添加--header标志,与现有的query range行为匹配。#18418
  • [改进]:AWS服务发现:允许EC2服务发现IPv6地址用于与目标端点通信。当同时存在IPv4和IPv6地址时,默认仍使用私有IPv4地址。#16088
  • [性能] TSDB:将范围查询中的头块查找优化为常数时间复杂度,替代原来的二次时间复杂度。#18302
  • [性能] TSDB:在mmapHeadChunks中,当无需内存映射系列时跳过整个条带,在生产相关规模下显著降低CPU使用率。#18541
  • [性能] TSDB:在周期性头块mmap期间,使用缓存的头块计数跳过干净系列。#18272
  • [性能] PromQL:解决Go 1.26上FloatHistogram.KahanAdd的性能回退问题。#18568
  • [错误修复] PromQL:修复info()函数错误处理否定的__name__匹配器的问题。#17932
  • [错误修复] API:在/parse_ast中返回持续时间表达式。#18624
  • [错误修复] API:在OpenAPI规范中正确记录持续时间查询请求参数(step、timeout和lookback delta)接受的格式。#18305
  • [错误修复] 抓取:当发生乱序/重复系列错误时,AppenderV2现在像AppenderV1一样跟踪陈旧性。#18567
  • [错误修复] 配置:在加载时验证remote_write的queue_config字段,以防止运行时崩溃和静默配置错误。#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:修复在持续时间表达式(如foo[5m+range()])中解析range()关键字的问题。#18623
  • [错误修复] PromQL:修复当使用@修饰符时,平滑向量选择器在二元运算中返回无结果的问题。#18531
  • [错误修复] PromQL:拒绝NaN、无穷大和超出范围的持续时间表达式,而非静默生成超出范围的time.Duration。#18639
  • [错误修复] 抓取:修复抓取格式错误的原生直方图时的崩溃问题。#18414
  • [错误修复] 抓取:修复通过protobuf格式抓取暴露无分位数摘要的目标时的崩溃问题。#18382
  • [错误修复] 抓取:修复配置重载后,抓取失败日志文件偶尔未应用的问题。#18428
  • [错误修复] TSDB:允许新数据路径的保留百分比。#18628
  • [错误修复] TSDB:在基于百分比的保留中保持十进制精度。#18374
  • [错误修复] TSDB:修复在WAL重放后prometheus_tsdb_head_chunks变为负值的问题。#18401
  • [错误修复] TSDB:查询重叠块时原生直方图的崩溃问题。#18692
  • [错误修复] 追踪:修复非安全OTLP HTTP追踪的启动失败问题。#18469
  • [错误修复] 用户界面:转义PromQL自动补全提供的标签值。#18658
  • [错误修复] 用户界面:提高小范围图形值的Y轴刻度标签精度。#18682
  • [错误修复] 当抓取任务被删除时,特定抓取任务的prometheus_sd_refresh*prometheus_sd_discovered_targets指标会被删除。#17614
  • [错误修复] 远程:修复在解析元数据单位符号时对收到的RW2请求的验证。这修复了可能导致(已恢复)处理程序崩溃的情况。#18641
  • [错误修复] TSDB/代理:修复代理追加器中的竞态条件,其中同一标签集的并发追加可能产生重复的内存系列和重复的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

下载链接