Include multiple configuration files (scrape_configs in different files)

已查看 3,109 次
跳至第一个未读帖子

lerh...@gmail.com

未读,
2017年10月6日 00:48:002017/10/6
收件人 Prometheus Users
Hello all, 

This may sound like a stupid question but I haven't had much luck googling it. I'm wondering if there is an existing way to include multiple files in Prometheus. This is to help me with a few things: 

i) Make it more organizable instead of have everything in a single file. So I could have a scrape_config in one ec2.yaml, another scrape_config in k8s.yaml, and in my main prometheus.yaml I can just state that it includes both YAMLs. My Prometheus would then scrape both targets defined in both files. Currently it seems possible only with rule_files, which does not accept a prometheus config (it only accepts rules). 

ii) I currently am experimenting with Tectonic and would like to be able to drop rule files in set places to use with the Prometheus Operator resource. There's an existing config reloader image that is able to reload prometheus, but the trigger seems to be based only if there are rule file changes (the main prometheus.yaml is configured automatically by Tectonic). So if I added in a test.rules file, it will add it to the YAML, but I am unable to specify scrape_configs in that rule file because it will complain: unexpected <op:-> in record statement, expected "="

Anyone have any suggestions? 

Thanks! 

Ben Kochie

未读,
2017年10月6日 03:37:362017/10/6
收件人 lerh...@gmail.com、Prometheus Users
Only one configuration file is supported, in order to reduce the complexity of the configuration loader.  Handling configuration is a job for configuration management software.

--
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/e0106126-4fc0-42aa-824d-d5a0eef9d42f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lerh...@gmail.com

未读,
2017年10月8日 19:15:482017/10/8
收件人 Prometheus Users
I see, thanks for confirming. 


On Friday, October 6, 2017 at 6:37:36 PM UTC+11, Ben Kochie wrote:
Only one configuration file is supported, in order to reduce the complexity of the configuration loader.  Handling configuration is a job for configuration management software.
On Fri, Oct 6, 2017 at 6:48 AM, <lerh...@gmail.com> wrote:
Hello all, 

This may sound like a stupid question but I haven't had much luck googling it. I'm wondering if there is an existing way to include multiple files in Prometheus. This is to help me with a few things: 

i) Make it more organizable instead of have everything in a single file. So I could have a scrape_config in one ec2.yaml, another scrape_config in k8s.yaml, and in my main prometheus.yaml I can just state that it includes both YAMLs. My Prometheus would then scrape both targets defined in both files. Currently it seems possible only with rule_files, which does not accept a prometheus config (it only accepts rules). 

ii) I currently am experimenting with Tectonic and would like to be able to drop rule files in set places to use with the Prometheus Operator resource. There's an existing config reloader image that is able to reload prometheus, but the trigger seems to be based only if there are rule file changes (the main prometheus.yaml is configured automatically by Tectonic). So if I added in a test.rules file, it will add it to the YAML, but I am unable to specify scrape_configs in that rule file because it will complain: unexpected <op:-> in record statement, expected "="

Anyone have any suggestions? 

Thanks! 

--
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.
回复全部
回复作者
转发
0 个新帖子