Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to setup Prometheus with Eureka SD without file_sd_configs?

I'm trying to setup Prometheus and Eureka Discovery Service on Cloud Foundry. From the documentation of Prometheus I know that it is possible using file-based configuration (file_sd_configs). Simply, when Eureka found a new service a configuration file specified in section file_sd_configs need to be updated with a information about new service and Prometheus will get a new configuration. It means the necessary is to write a bridge-app to retrieves changes from an arbitrary service discovery mechanism and writes the target information to the watched files as lists of target groups. Finally, an architecture looks as follow: 1. Cloud Foundry:App 1. Eureka SD 2. Cloud Foundry:App 2. bridge-app 3. Cloud Foundry:App 3. Prometheus

Here is a problem. I cannot share any resource like a file (nfs is not available) between bridge-app and Prometheus instance it means that I cannot update Prometheus configuration from bridge-app.


I assume that I can extend Prometheus adding Eureka to discovery backends but I have no skills in Go.

Any ideas?

like image 253
tomasz-mer Avatar asked Mar 08 '23 18:03

tomasz-mer


2 Answers

Prometheus does not support Eureka service discovery (yet). However, there is adapter that you can deploy with your Eureka instance. This adapter provides several HTTP endpoints that return information of the registered services and are compatible with the Prometheus' Consul discovery client (consul_sd_config). I have tested it for a couple of month now and it works great. It is available on Github: https://github.com/twinformatics/eureka-consul-adapter

like image 98
tine2k Avatar answered Mar 10 '23 08:03

tine2k


With recent release of Prometheus 2.21.0 it is possible to use Eureka SD.

like image 22
Danny Avatar answered Mar 10 '23 06:03

Danny