prometheus.yml如下:remote_read:- url: 'http://prom_ip:prom_port/api/v1/read'read_recent: truebasic_auth:username: app_idpassword: token

global:external_labels:
external_labels 会被附加在 Remote read 的查询条件中,不正确的 label 可能导致查询不到需要的数据。
filter_external_labels: false 配置项可以避免将 external_labels 加入查询条件(v2.34 版本以上支持)。# remote read 目标 prometheus 实例的 api 地址url: <string># 标识一个唯一的 remote read 配置名称[ name: <string> ]# 查询 promql 中必须包含以下 label 过滤条件才会进行 remote read 查询required_matchers:[ <labelname>: <labelvalue> ... ]# remote read 查询超时时间[ remote_timeout: <duration> | default = 1m ]# 自定义 remote read 请求中附带的 headers,无法覆盖 prometheus 原本添加的 headersheaders:[ <string>: <string> ... ]# 在本地有完整数据存储的时间范围是否进行 remote read 查询[ read_recent: <boolean> | default = false ]# 为每个 remote read 请求添加 Authorization header,password password_file 二选一basic_auth:[ username: <string> ][ password: <secret> ][ password_file: <string> ]# 自定义 Authorization header 配置authorization:# 认证类型[ type: <string> | default: Bearer ]# 认证密钥,credentials credentials_file 二选一[ credentials: <secret> ]# 密钥从文件中获取[ credentials_file: <filename> ]# OAuth2.0认证,不能与 basic_auth authorization 同时使用oauth2:[ <oauth2> ]# TLS 配置tls_config:[ <tls_config> ]# 代理 URL[ proxy_url: <string> ]# 查询请求是否接受3XX 跳转[ follow_redirects: <boolean> | default = true ]# 是否启用 HTTP2[ enable_http2: <bool> | default: true ]# 是否在 remote read 时附加 external_labels[ filter_external_labels: <boolean> | default = true ]
文档反馈