发布日期: 2025-10-15
版本号: v3.7.0

请注意,OTLP端点存在一项重要变更:以下划线开头的OpenTelemetry属性名(例如_attrib)不再自动转换为key_attrib格式,如需使用OTLP摄取功能,建议改用3.7.1版本。本次更新包括:废弃了远程写入中部分指标,推荐使用新指标替代;新增了多项功能,如支持实验性PromQL扩展选择器、原生直方图自定义桶联邦、特定PromQL函数及多种远程写入认证与配置选项;改进了PromQL、UI、TSDB及规则引擎的性能与细节;大幅提升了OTLP、PromQL及TSDB的处理效率;并修复了涉及告警配置、指标采集、直方图处理、远程写入协议及UI显示在内的众多错误。

更新内容 (中文)

警告

我们发现 OTLP 端点存在一个破坏性变更:以下划线开头的 OpenTelemetry 属性名称(例如 _attrib)将不再自动转换为 key_attrib。请使用 3.7.1 版本进行 OTLP 数据摄入。

变更日志

  • [变更] 远程写入:以下指标已弃用:
    • prometheus_remote_storage_samples_in_total,请使用 prometheus_wal_watcher_records_read_total{type="samples"}prometheus_remote_storage_samples_dropped_total 代替,
    • prometheus_remote_storage_histograms_in_total,请使用 prometheus_wal_watcher_records_read_total{type=~".*histogram_samples"}prometheus_remote_storage_histograms_dropped_total 代替,
    • prometheus_remote_storage_exemplars_in_total,请使用 prometheus_wal_watcher_records_read_total{type="exemplars"}prometheus_remote_storage_exemplars_dropped_total 代替,
    • prometheus_remote_storage_highest_timestamp_in_seconds,请在仪表盘和警报中使用更准确的 prometheus_remote_storage_queue_highest_timestamp_seconds 以正确计入重标签并提高准确性。#17065
  • [功能] PromQL:在功能标志 promql-extended-range-selectors 下添加对实验性锚定和平滑速率的支持。#16457
  • [功能] 联邦:添加对具有自定义桶的本机直方图 (NHCB) 的支持。#17215
  • [功能] PromQL:在功能标志 experimental-promql-functions 下添加 first_over_time(...)ts_of_first_over_time(...)。#16963 #17021
  • [功能] 远程写入:添加对 Azure Workload Identity 作为接收器认证方法的支持。#16788
  • [功能] 远程写入:在启用 type-and-unit-labels 功能标志时,为远程写入 2.0 中发出的时间序列添加类型和单位标签。#17033
  • [功能] OTLP:在启用 created-timestamp-zero-ingestion 功能标志时,将指标的开始时间作为创建时间零样本写入 TSDB。#16951
  • [增强] PromQL:为某些直方图操作中的计数器重置冲突添加警告级注释。#17051 #17094
  • [增强] UI:在目标页面添加抓取间隔和抓取超时。#17158
  • [增强] TSDB:如果模式是指数型的,则降低从数据块或远程读取中读取的本机直方图的分辨率。#17213
  • [增强] 远程写入:当在仅样本批次中发现元数据条目时,为样本批次中意外的元数据添加日志记录。#17034 #17082
  • [增强] 规则:支持对查询 ALERTSALERTS_FOR_STATE 的规则进行并发评估。#17064
  • [增强] TSDB:添加日志以提高内部操作的可见性。#17074
  • [性能] OTLP:接收 OTLP 指标时直接写入 TSDB,而非通过远程写入适配器。#16951
  • [性能] OTLP:减少从 OTLP 端点发出的日志数量。无需记录重复样本错误。#17201
  • [性能] PromQL:将更多工作移至预处理步骤。#16896
  • [性能] PromQL:遍历语法树时减少内存分配。#16593
  • [性能] TSDB:优化追加器创建,略微加快启动速度。#16922
  • [性能] TSDB:提高使用多个匹配器查询序列的速度。#13971
  • [错误修复] 警报:在 alertmanager_config.alert_relabel_configs 块内修改警报重标签(使用 replace 操作等)现在作用域正确,不会再向后续块传递修改后的警报。#17063
  • [错误修复] 配置:在设置抓取配置验证方案时推断有效的转义方案。#16923
  • [错误修复] TSDB:正确处理向同一序列追加混合类型样本的情况。#17071 #17241 #17290 #17295 #17296
  • [错误修复] 远程写入:防止通过远程写入 1.0 发送不支持的具有自定义桶的本机直方图 (NHCB),并记录警告。#17146
  • [错误修复] TSDB:修复在 protobuf 抓取中针对具有自定义桶的本机直方图 (NHCB) 的 metadata-wal-records 实验性功能的元数据条目处理。#17156
  • [错误修复] TSDB:在 WAL/WBL 重放期间忽略具有无效模式的本机直方图。#17214
  • [错误修复] PromQL:避免 histogram_quantile() 注释中的指标名称为空。#16794
  • [错误修复] PromQL:更正某些聚合表达式错误中不准确的字符位置。#16996 #17031
  • [错误修复] PromQL:修复在频繁变动的序列上 info() 函数的问题。#17135
  • [错误修复] PromQL:当用负因子减去或乘除时,将本机直方图设置为仪表类型。#17004
  • [错误修复] TSDB:尝试向 TSDB 追加时拒绝不支持的本机直方图模式。对于抓取和远程写入,如果模式在 -9 到 52 之间,请实施降低分辨率以适应最大值的方案。#17189
  • [错误修复] 远程写入:修复 HTTP 处理程序,在写入无效压缩的错误响应后立即返回。#17050
  • [错误修复] 远程写入:对于格式错误的本机直方图,返回 HTTP 错误 400 而不是 5xx。#17210
  • [错误修复] 抓取:防止过时标记生成不必要的序列。#16429
  • [错误修复] TSDB:避免在 WAL 清理期间产生误导性的 Failed to calculate size of \"wal\" dir 错误日志。#17006
  • [错误修复] TSDB:防止在 WAL 检查点期间错误地丢弃序列记录。#17029
  • [错误修复] UI:修复在配置了 -web.route-prefix 时重定向到 -web.external-url 路径的问题。#17240
  • [错误修复] 远程写入:在远程写入 2.0 中遇到无效符号表时不再发生恐慌。#17160

更新内容 (原始)

Warning

We discovered a breaking change in the OTLP endpoint: OpenTelemetry attribute names starting with underscore, for example _attrib, are no longer automatically translated to key_attrib. Please use 3.7.1 instead for OTLP ingestion.

Changelog

  • [CHANGE] Remote-write: the following metrics are deprecated:
    • prometheus_remote_storage_samples_in_total, use prometheus_wal_watcher_records_read_total{type="samples"} and prometheus_remote_storage_samples_dropped_total instead,
    • prometheus_remote_storage_histograms_in_total, use prometheus_wal_watcher_records_read_total{type=~".*histogram_samples"} and prometheus_remote_storage_histograms_dropped_total instead,
    • prometheus_remote_storage_exemplars_in_total, use prometheus_wal_watcher_records_read_total{type="exemplars"} and prometheus_remote_storage_exemplars_dropped_total instead,
    • prometheus_remote_storage_highest_timestamp_in_seconds, use the more accurate prometheus_remote_storage_queue_highest_timestamp_seconds instead in dashboards and alerts to properly account for relabeling and for more accuracy. #17065
  • [FEATURE] PromQL: Add support for experimental anchored and smoothed rate behind feature flag promql-extended-range-selectors. #16457
  • [FEATURE] Federation: Add support for native histograms with custom buckets (NHCB). #17215
  • [FEATURE] PromQL: Add first_over_time(...) and ts_of_first_over_time(...) behind feature flag experimental-promql-functions. #16963 #17021
  • [FEATURE] Remote-write: Add support for Azure Workload Identity as an authentication method for the receiver. #16788
  • [FEATURE] Remote-write: Add type and unit labels to outgoing time series in remote-write 2.0 when the type-and-unit-labels feature flag is enabled. #17033
  • [FEATURE] OTLP: Write start time of metrics as created time zero samples into TSDB when created-timestamp-zero-ingestion feature flag is enabled. #16951
  • [ENHANCEMENT] PromQL: Add warn-level annotations for counter reset conflicts in certain histogram operations. #17051 #17094
  • [ENHANCEMENT] UI: Add scrape interval and scrape timeout to targets page. #17158
  • [ENHANCEMENT] TSDB: Reduce the resolution of native histograms read from chunks or remote read if the schema is exponential. #17213
  • [ENHANCEMENT] Remote write: Add logging for unexpected metadata in sample batches, when metadata entries are found in samples-only batches. #17034 #17082
  • [ENHANCEMENT] Rules: Support concurrent evaluation for rules querying ALERTS and ALERTS_FOR_STATE. #17064
  • [ENHANCEMENT] TSDB: Add logs to improve visibility into internal operations. #17074
  • [PERF] OTLP: Write directly to TSDB instead of passing through a Remote-Write adapter when receiving OTLP metrics. #16951
  • [PERF] OTLP: Reduce number of logs emitted from OTLP endpoint. No need to log duplicate sample errors. #17201
  • [PERF] PromQL: Move more work to preprocessing step. #16896
  • [PERF] PromQL: Reduce allocations when walking the syntax tree. #16593
  • [PERF] TSDB: Optimize appender creation, slightly speeding up startup. #16922
  • [PERF] TSDB: Improve speed of querying a series with multiple matchers. #13971
  • [BUGFIX] Alerting: Mutating alerts relabeling (using replace actions, etc.) within a alertmanager_config.alert_relabel_configs block is now scoped correctly and no longer yields altered alerts to subsequent blocks. #17063
  • [BUGFIX] Config: Infer valid escaping scheme when scrape config validation scheme is set. #16923
  • [BUGFIX] TSDB: Correctly handle appending mixed-typed samples to the same series. #17071 #17241 #17290 #17295 #17296
  • [BUGFIX] Remote-write: Prevent sending unsupported native histograms with custom buckets (NHCB) over Remote-write 1.0, log warning. #17146
  • [BUGFIX] TSDB: Fix metadata entries handling on metadata-wal-records experimental feature for native histograms with custom buckets (NHCB) in protobuf scraping. #17156
  • [BUGFIX] TSDB: Ignore Native Histograms with invalid schemas during WAL/WBL replay. #17214
  • [BUGFIX] PromQL: Avoid empty metric names in annotations for histogram_quantile(). #16794
  • [BUGFIX] PromQL: Correct inaccurate character positions in errors for some aggregate expressions. #16996 #17031
  • [BUGFIX] PromQL: Fix info() function on churning series. #17135
  • [BUGFIX] PromQL: Set native histogram to gauge type when subtracting or multiplying/dividing with negative factors. #17004
  • [BUGFIX] TSDB: Reject unsupported native histogram schemas when attempting to append to TSDB. For scrape and remote-write implement reducing the resolution to fit the maximum if the schema is within the -9 to 52. #17189
  • [BUGFIX] Remote-write: Fix HTTP handler to return after writing error response for invalid compression. #17050
  • [BUGFIX] Remote-write: Return HTTP error 400 instead of 5xx for wrongly formatted Native Histograms. #17210
  • [BUGFIX] Scrape: Prevent staleness markers from generating unnecessary series. #16429
  • [BUGFIX] TSDB: Avoid misleading Failed to calculate size of \"wal\" dir error logs during WAL clean-up. #17006
  • [BUGFIX] TSDB: Prevent erroneously dropping series records during WAL checkpoints. #17029
  • [BUGFIX] UI: Fix redirect to path of -web.external-url if -web.route-prefix is configured. #17240
  • [BUGIFX] Remote-write: Do not panic on invalid symbol table in remote-write 2.0. #17160

下载链接