Prometheus with Eureka Discovery

187 views
Skip to first unread message

sunil sagar

unread,
Oct 3, 2020, 10:25:01 PM10/3/20
to Prometheus Users
Hi All ,

I am setting up Prometheus in Kubernetes . And I want to load service discovery config from external source over URL . The json file is accessible over URL .

I have checked the Prometheus document and it seems this can be achieved using eureka .

I have no experience with eureka , how to setup so that I can use in Prometheus .

I checked in Google , no much information available .
Please suggest some document or other alternative solution I can achieve by accessing json from URL .

Thanks

Brian Candler

unread,
Oct 4, 2020, 3:48:12 AM10/4/20
to Prometheus Users
On Sunday, 4 October 2020 03:25:01 UTC+1, sunil sagar wrote:

I am setting up Prometheus in Kubernetes . And I want to load service discovery config from external source over URL . The json file is accessible over URL .

I have checked the Prometheus document and it seems this can be achieved using eureka .


Which prometheus document? What makes you think you can use eureka SD to load arbitrary JSON files?
 

I have no experience with eureka , how to setup so that I can use in Prometheus .

I checked in Google , no much information available .


which in turn links to Netflix Eureka's documentation - but I don't think that's what you actually want.
 

Please suggest some document or other alternative solution I can achieve by accessing json from URL .


Use file_sd_config to read your targets from a file.   Write a cronjob which fetches JSON from a remote URL into another file, and if there is no error, uses 'mv' to replace the targets file with the one just fetched.

Prometheus will notice that the file has changed, and automatically read its contents.

Sagar

unread,
Oct 6, 2020, 7:39:53 AM10/6/20
to Brian Candler, Prometheus Users
Thank you for your help on this . 
I am going to follow the same design , will place cron and let json get download when new endpoint is added . 

Thanks 
Sunil Sagar

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/c7f9be47-34ea-4f71-9e8d-32c19fc8759fo%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages