I have been working on Prometheus for the last one year, with various exporters like Redis, MongoDB, ElasticSearch, Nginx, etc. Recently I started working on JMX exporter for Kafka and Cassandra which is a 3rd party exporter. I have created a "Kafka port forwarder(KPF)" instance that runs JMX exporter, with kafka.yaml file. If anyone of you might be knowing, JMX has opened a remote port for Kafka at :10054. We have multiple kafka servers with 10054 remote port. We have tweaked the kafka.yaml to scrape metrics from one of the Kafka server over :7071, so we provide :7071 to Prometheus config file. But now we need to do the same for, say 50 Kafka servers.
So I wanted to know if there is a way we can provide port range for a job-name or target-group in Prometheus config file. I know it is complicated. I am providing a diagram to simplify my architecture. Kafka-port-forwarding
Also, we need to open two ports per Kafka server (the other is for Zookeeper). This may also be used for any other service not just Kafka.