Remote file service discovery

116 views
Skip to first unread message

Matthew Mueller

unread,
Jul 6, 2017, 2:32:02 PM7/6/17
to Prometheus Users
Is it possible to configure remote discovery to look for a remote static text file, like a text file or directory on S3?

Matthew Mueller

unread,
Jul 6, 2017, 2:42:22 PM7/6/17
to Prometheus Users
Sorry this was a bit unclear, I'm wondering if it's possible to pull scrapers from a directory like  an S3 bucket?

Nicholas Capo

unread,
Jul 6, 2017, 2:45:18 PM7/6/17
to Matthew Mueller, Prometheus Users

As far as I know this is not supported. But you could always run a sidecar script to download the file. If you configure Prometheus using file_sd_configs it will automatically detect changes to the file and start scraping the new targets.

Nicholas


--
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 post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/ff8a6556-0e05-4fb5-bd18-63be2121b3d1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Julius Volz

unread,
Jul 6, 2017, 5:29:35 PM7/6/17
to Nicholas Capo, Matthew Mueller, Prometheus Users
Correct, we only have one way of doing generic SD (intentionally don't want to introduce multiple), and it is local-file-based only at the moment.

On Thu, Jul 6, 2017 at 8:45 PM, Nicholas Capo <nichol...@gmail.com> wrote:

As far as I know this is not supported. But you could always run a sidecar script to download the file. If you configure Prometheus using file_sd_configs it will automatically detect changes to the file and start scraping the new targets.

Nicholas

On Thu, Jul 6, 2017, 13:42 Matthew Mueller <mattm...@gmail.com> wrote:
Sorry this was a bit unclear, I'm wondering if it's possible to pull scrapers from a directory like  an S3 bucket?


On Friday, July 7, 2017 at 1:32:02 AM UTC+7, Matthew Mueller wrote:
Is it possible to configure remote discovery to look for a remote static text file, like a text file or directory on S3?

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAKA4%2B6roZsoDEB7LG7GKbTpYAiKUrCgq8j4sJrEeGu88eL2VbA%40mail.gmail.com.

Matthew Mueller

unread,
Jul 7, 2017, 2:37:57 AM7/7/17
to Prometheus Users, nichol...@gmail.com, mattm...@gmail.com
Got it, would it be possible to take a plugin approach with SD? I'd be happy to write this piece of functionality if it's possible to do outside of core.

The reason this would be cool is you could treat S3 as your push gateway and anytime you push to that bucket with some key (text file name), prometheus will pick up that new script / function / short-running task.


On Friday, July 7, 2017 at 4:29:35 AM UTC+7, Julius Volz wrote:
Correct, we only have one way of doing generic SD (intentionally don't want to introduce multiple), and it is local-file-based only at the moment.
On Thu, Jul 6, 2017 at 8:45 PM, Nicholas Capo <nichol...@gmail.com> wrote:

As far as I know this is not supported. But you could always run a sidecar script to download the file. If you configure Prometheus using file_sd_configs it will automatically detect changes to the file and start scraping the new targets.

Nicholas

On Thu, Jul 6, 2017, 13:42 Matthew Mueller <mattm...@gmail.com> wrote:
Sorry this was a bit unclear, I'm wondering if it's possible to pull scrapers from a directory like  an S3 bucket?


On Friday, July 7, 2017 at 1:32:02 AM UTC+7, Matthew Mueller wrote:
Is it possible to configure remote discovery to look for a remote static text file, like a text file or directory on S3?

--
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 post to this group, send email to promethe...@googlegroups.com.

--
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 post to this group, send email to promethe...@googlegroups.com.

Matthew Mueller

unread,
Jul 7, 2017, 2:39:40 AM7/7/17
to Prometheus Users, nichol...@gmail.com, mattm...@gmail.com
This is effectively what a sitemap.xml would do for google crawling, but you could do it for metrics and service discovery too!

Ben Kochie

unread,
Jul 7, 2017, 2:48:32 AM7/7/17
to Matthew Mueller, Prometheus Users, Nicholas Capo
I've suggested we add support for URLs in the file_sd_configs, as just another way to access those files.  This would provide for a simple way to add remote discovery.

Longer-term, we're starting a project within the CNCF to create a common/standard service discovery API. 

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/3236063e-d33b-4bc4-8b7d-e92ac496727c%40googlegroups.com.

Matthew Mueller

unread,
Jul 7, 2017, 3:16:06 AM7/7/17
to Prometheus Users, mattm...@gmail.com, nichol...@gmail.com
Awesome! Both would be very welcome improvements I think. 

The URLs would definitely help, but the only downside there is you need to restart the service every time a new one comes online or you'd need to coordinate S3 updates to merge all metrics across the network before pushing that file. 

I think for now, I'll probably stick with either a sidecar thing or DNS service discovery since that doesn't require restarts and is pretty quick to add (assuming it's just SRV records).

Ben Kochie

unread,
Jul 7, 2017, 3:57:32 AM7/7/17
to Matthew Mueller, Nicholas Capo, Prometheus Users
I think we may be confusing some symantics.  

The idea I'm proposing is one file for all targets.  Prometheus would refresh this URL every N seconds.

If you are talking about a file per target, I think this is the wrong approach and you should use a more standard service register like Consul.

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/85868b43-d6e4-448f-867a-38e7e5defa24%40googlegroups.com.

Matthias Rampke

unread,
Jul 7, 2017, 5:25:31 AM7/7/17
to Ben Kochie, Matthew Mueller, Nicholas Capo, Prometheus Users

…or a side car. Think of file_sd as the plugin mechanism. There is no need to restart or (I think) even reload.


--
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 post to this group, send email to promethe...@googlegroups.com.

Julius Volz

unread,
Jul 7, 2017, 7:49:47 AM7/7/17
to Matthias Rampke, Ben Kochie, Matthew Mueller, Nicholas Capo, Prometheus Users
Btw., the general idea of implementing a generic SD over HTTP was discussed before: https://github.com/prometheus/prometheus/issues/2514

So far, the answer to it seems to be no, but I don't have strong feelings about it.

To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.

--
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-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CAFU3N5WgEgPGZ%3DosEF_tzbmCUzLhXoWwTv6m%3D%3DUfPKACMd6qGQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages