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?
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
With recent release of Prometheus 2.21.0 it is possible to use Eureka SD.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With