'Flink with SBT : Expose metrics to Prometheus
I have a Flink application written in Scala that I build with SBT. My goal is to expose Flink metrics to Prometheus. Prometheus runs in a Docker instance and my Flink application is lauched with SBT on my computer.
Prometheus is working fine, I can see many metrics (for example my Docker metrics) but I can't see any Flink metric.
I've configured the file prometheus.yml with the following settings :
scrape_configs:
- job_name: 'flink'
static_configs:
- targets: ['host.docker.internal:9250', 'host.docker.internal:9251']
and in my flink application, I've add the following config :
val conf = new Configuration()
conf.setLong("rest.port", 8082)
conf.setString("metrics.reporters", "prom")
conf.setString("metrics.reporter.prom.class", "org.apache.flink.metrics.prometheus.PrometheusReporter")
conf.setString("metrics.reporter.prom.port", "9250-9260")
When I run Prometheus and my flink application, and I go to the metrics page, all flink targets are down (picture here).
Any suggestions about what I'm doing wrong ?
Thanks a lot.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
