简体   繁体   English

为什么 Flink 使用 Pushgateway 而不是 Prometheus 通常的 pull 模型进行一般指标收集?

[英]Why Flink uses the Pushgateway instead of Prometheus's usual pull model for general metrics collection?

We can see Flink uses the Pushgateway instead of Prometheus's usual pull model for general metrics collection when exposing Flink Metrics to an external system such as Prometheus.我们可以看到,在将 Flink Metrics 暴露给 Prometheus 等外部系统时,Flink 使用 Pushgateway 而不是 Prometheus 通常的 pull 模型进行一般指标收集。

@Override
public void report() {
    try {
        pushGateway.push(CollectorRegistry.defaultRegistry, jobName);
    } catch (Exception e) {
        log.warn("Failed to push metrics to PushGateway with jobName {}.", jobName, e);
    }
}

https://github.com/apache/flink/blob/master/flink-metrics/flink-metrics-prometheus/src/main/java/org/apache/flink/metrics/prometheus/PrometheusPushGatewayReporter.java https://github.com/apache/flink/blob/master/flink-metrics/flink-metrics-prometheus/src/main/java/org/apache/flink/metrics/prometheus/PrometheusPushGatewayReporter.java

however from the Prometheus's official document below it states that "Prometheus scrapes metrics from instrumented jobs, either directly or via an intermediary push gateway for short-lived jobs " , obviously Flink Streaming job is not short-lived jobs, so why Flink uses the Pushgateway instead of Prometheus's usual pull model for general metrics collection?然而,从下面的 Prometheus 官方文档中,它指出“Prometheus 从检测作业中直接或通过中介推送网关为短期作业抓取指标”,显然 Flink Streaming 作业不是短期作业,那么为什么 Flink 使用 Pushgateway而不是普罗米修斯通常用于一般指标收集的拉模型?

https://prometheus.io/docs/introduction/overview/ https://prometheus.io/docs/introduction/overview/

Flink offers both the PrometheusPushGatewayReporter and the generally more appropriate pull-based PrometheusReporter . Flink 提供PrometheusPushGatewayReporter和通常更合适的基于拉取的PrometheusReporter Prometheus has become quite popular with Flink users, and there was interest in the community in supporting both types of connection. Prometheus 在 Flink 用户中非常受欢迎,社区对支持这两种类型的连接很感兴趣。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM