Closed12

Prometheus storage integration の remote read 間隔が知りたい。

wintwint

モチベ

実験すれば良いけど、静的に解析したい。
→ code reading

repo

https://github.com/prometheus/prometheus/tree/main/storage/remote

https://github.com/prometheus/prometheus/tree/main/cmd/prometheus

ref

https://prometheus.io/docs/prometheus/latest/storage/#remote-storage-integrations

Remote storage integrations

https://prometheus.io/docs/prometheus/latest/images/remote_integrations.png
remote integrations

https://prometheus.io/docs/operating/integrations/#remote-endpoints-and-storage

Remote Endpoints and Storage

https://www.metricfire.com/blog/prometheus-remote-storage/

Remote read
When configured, Prometheus storage queries (e.g. via the HTTP API) are sent to both local and remote storage, and results are merged.
Note that to maintain reliability in the face of remote storage issues, alerting and recording rule evaluation use only the local TSDB.

wintwint

結局、書き込みインターバルが scrape interval だと言う証拠は、まだ分からない。

引き続き evaluate interval が remote read interval に相当するかを検証する。

wintwint

eval loop

def

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/config/config.go#L380-L393

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/config/config.go#L387-L388

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/config/config.go#L400-L401

main

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/cmd/prometheus/main.go#L776-L802

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L1022-L1028

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/cmd/prometheus/main.go#L1200-L1214

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/cmd/prometheus/main.go#L650-L655

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L187-L190

engine

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/promql/engine.go#L247-L260

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/promql/engine.go#L279-L290

rules

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L953-L956

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L215-L222

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L184-L185

group

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L358

group interval

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L376-L380

loop

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L428-L447

rule group

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/rules/manager.go#L1095-L1099

https://github.com/prometheus/prometheus/blob/92d69803606620505ed8f0226abb640a121ec1cd/model/rulefmt/rulefmt.go#L88-L95

wintwint

ふりかえり

結局、いつ・どこで・だれが remote storage を fetch してんだよ。

このスクラップは2023/05/22にクローズされました