prometheus.erl icon indicating copy to clipboard operation
prometheus.erl copied to clipboard

Question on enabling collectors

Open dtaraf opened this issue 6 years ago • 3 comments

Hello,

I have been using a dot config file to enable collectors for prometheus and its working well for me. However if I wanted to enable / disable collectors in a more dynamic way, say having a web page from which I could select a collector and click a button called enabled or disable it similarly, so that no more metrices are sent to prometheus, is that something that can be done ? If so then can some pointers be given as to how to go about it roughly, what api I should be looking at etc ?

Thanks ! Devangana

dtaraf avatar Jul 04 '18 00:07 dtaraf

Hello, you can dynamically register and deregister collectors using functions from prometheus_registry module - https://github.com/deadtrickster/prometheus.erl/blob/master/doc/prometheus_registry.md. Its collectors function will return all registered collectors for particular registry.

deadtrickster avatar Jul 04 '18 06:07 deadtrickster

Thank you , will try these out!

dtaraf avatar Jul 04 '18 15:07 dtaraf

it looks like this ticket can be closed :-)

marco-m avatar Jan 07 '19 20:01 marco-m