Flink官网在Metrics方面对Prometheus的支持
参考Metric Reporters | Apache Flink
Prometheus #
(org.apache.flink.metrics.prometheus.PrometheusReporter) #
Parameters:
port
- (optional) the port the Prometheus exporter listens on, defaults to 9249. In order to be able to run several instances of the reporter on one host (e.g. when one TaskManager is colocated with the JobManager) it is advisable to use a port range like9250-9260
.filterLabelValueCharacters
- (optional) Specifies whether to filter label value characters. If enabled, all characters not matching [a-zA-Z0-9:_] will be removed, otherwise no characters will be removed. Before disabling this option please ensure that your label values meet the Prometheus requirements.
Example configuration:
metrics.reporter.prom.class: org.apache.flink.metrics.prometheus.PrometheusReporter
Flink metric types are mapped to Prometheus metric types as follows:
Flink | Prometheus | Note |
---|---|---|
Counter | Gauge | Prometheus counters cannot be decremented. |
Gauge | Gauge | Only numbers and booleans are supported. |
Histogram | Summary | Quantiles .5, .75, .95, .98, .99 an |