prometheus.erl
prometheus.erl copied to clipboard
Question on enabling collectors
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
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.
Thank you , will try these out!
it looks like this ticket can be closed :-)