Flink metrics的幾種方式總結

2021-09-28 18:42:23 字數 3930 閱讀 7440

下面所有的配置都是在flink-conf.yaml 中配置

flink 有以下幾種metrics reporter :

1、jmx (org.apache.flink.metrics.jmx.jmxreporter)

引數:port :  連線jmx listens的埠,如果有多個taskmanger在同一臺機器,埠可以設定成範圍9250-9260

配置:      

metrics.reporter.jmx.factory.class: org.apache.flink.metrics.jmx.jmxreporte***ctory

metrics.reporter.jmx.port: 8789

2、graphite (org.apache.flink.metrics.graphite.graphitereporter)

複製/opt/flink-metrics-graphite-1.9.0.jar/lib

配置:

metrics.reporter.grph.class: org.apache.flink.metrics.graphite.graphitereporter

metrics.reporter.grph.host: localhost # graphite server host

metrics.reporter.grph.port: 2003 #graphite server port

metrics.reporter.grph.protocol: tcp #protocol to use (tcp/udp)

3、influxdb (org.apache.flink.metrics.influxdb.influxdbreporter)

複製/opt/flink-metrics-influxdb-1.9.0.jar/lib

配置:

metrics.reporter.influxdb.class: org.apache.flink.metrics.influxdb.influxdbreporter

metrics.reporter.influxdb.host: localhost #the influxdb server host

metrics.reporter.influxdb.port: 8086 # (optional) the influxdb server port, defaults to 8086

metrics.reporter.influxdb.db: flink #the influxdb database to store metrics

metrics.reporter.influxdb.username: flink-metrics # (optional) influxdb username

metrics.reporter.influxdb.password: qwerty #(optional) influxdb username』s password

metrics.reporter.influxdb.retentionpolicy: one_hour # (optional) influxdb retention policy

4、prometheus (org.apache.flink.metrics.prometheus.prometheusreporter)

複製/opt/flink-metrics-prometheus_2.11-1.9.0.jarinto the/lib

配置:

埠預設是9249

metrics.reporter.prom.class: org.apache.flink.metrics.prometheus.prometheusreporter
5、prometheuspushgateway (org.apache.flink.metrics.prometheus.prometheuspushgatewayreporter)

copy/opt/flink-metrics-prometheus-1.9.0.jarinto the/lib

配置:

metrics.reporter.promgateway.class: org.apache.flink.metrics.prometheus.prometheuspushgatewayreporter

metrics.reporter.promgateway.host: localhost

metrics.reporter.promgateway.port: 9091

metrics.reporter.promgateway.jobname: myjob

metrics.reporter.promgateway.randomjobnamesuffix: true

metrics.reporter.promgateway.deleteonshutdown: false

6、statsd (org.apache.flink.metrics.statsd.statsdreporter)

copy/opt/flink-metrics-statsd-1.9.0.jarinto the/lib

配置:

配置:

配置:

metrics.reporter.slf4j.class: org.apache.flink.metrics.slf4j.slf4jreporter

metrics.reporter.slf4j.interval: 60 seconds

Flink Metrics 原始碼解析

flink metrics 有如下模組 flink metrics 原始碼解析 flink metrics core flink metrics 原始碼解析 flink metrics datadog flink metrics 原始碼解析 flink metrics dropwizard flin...

mysql幾種索引 mysql的幾種索引

為什麼建立索引後,速度就會變快?答 使用索引後,查詢是按二叉樹演算法來查詢到記錄 索引使用的注意事項 索引的代價 1.占用磁碟空間 2.對dml 新增 修改 刪除 操作有影響,變慢 在哪些列上適合新增索引 1.較頻繁的作為查詢條件字段應該建立索引 select from emp where empn...

mysql幾種語言 mysql的幾種SQL語句

一 資料查詢語言 dql dql全稱 data query language,作用是從表中獲取資料,用的最多的關鍵字是select,保留字有where order by group by等 1 select user,host from mysql.user select user,host fro...