export - 如何保证 Prometheus 拉取的数据是最新的,不包含拉取区间之前的旧数据
问题描述
Prometheus 区间从 pushgateway 中拉取数据。pushgateway 使用“-persistence.file string”数据持久化参数配置。客户端实时向推送网关发送数据。
如果 Prometheus 在时间间隔内拉取数据。Pushgateway 没有收到来自客户端的数据。当 Prometheus 从 pushgateway 区间拉取数据时会发生什么?
- Prometheus会在时间间隔之外拉取旧数据,然后把拉取时间作为旧数据的时间吗?
- prometheus会根据pull时间间隔判断,pushgateway在此期间没有新数据,然后pull数据为空?
- 还有其他结果
解决方案
Pushgateway 将始终为组提供最近的推送(如果有)。如果您只关心获取最近的数据,那么 pushgateway 不适合您的用例(请参阅https://prometheus.io/docs/practices/pushing/)。
您可能想要做的是使用直接检测,并让 Prometheus 直接抓取您的应用程序。
推荐阅读
- asp.net-core - Asp.Net Core 5 auth 中间件发生在配置中指定的顺序错误
- java - Spring Boot 更改静态路径模式不自动提供 index.html
- javascript - 如何动态设置选择选项?
- angular - 更新到 Angular 11 后在 chrome 中调试问题
- html - CSS过渡属性不适用于Transform
- python - 在 python 的 fileoutput.writelines() 中使用 if else
- c# - 如何在静态方法中引用 WPF ItemsControl?
- java - 使用 Json SchemaGenerator 作为 JsonNode 创建模式节点
- java - Android Studio Youtube API 使用 setOnClickListener NullPointerException
- java - 如何在 jboss eap 7.3 上启用 cors?