Contents

【flink/prometheus/pushgateway】flink1.13.6配置pushgateway

Contents

  • 设pushgateway ip为192.168.100.100

  • 复制flink-metrics-prometheus-1.13.6.jar到lib目录

    cp /opt/flink-1.13.6/plugins/metrics-prometheus/flink-metrics-prometheus-1.13.6.jar
     /opt/flink-1.13.6/lib/flink-metrics-prometheus-1.13.6.jar
    
  • 配置flink配置文件

    vim /opt/flink-1.13.6/conf/flink-conf.yaml
    
    metrics.reporter.promgateway.class:org.apache.flink.metrics.prometheus.PrometheusPushGatewayReporter
    metrics.reporter.promgateway.host: 192.168.100.100
    metrics.reporter.promgateway.port: 9091
    metrics.reporter.promgateway.jobName: alert4flink
    metrics.reporter.promgateway.randomJobNameSuffix: true
    metrics.reporter.promgateway.deleteOnShutdown: false
    

9091是pushgateway的默认端口

jobname是自己定义的名字,随便写

randomJobNameSuffix是给刚才jobname后面加一个随机字符串,例如:alert4flink2fbce5cdce914907eb989f00c5587101

deleteOnShutdown是true的时候在flink挂掉时候就不监控pushgateway了