A registry of Collectors.
The majority of users should use the default
, rather than their own.
Creating a registry other than the default is primarily useful for unit tests, or pushing a subset of metrics to the Pushgateway from batch jobs.
collect_callback() = fun((registry(), prometheus_collector:collector()) -> any())
registry() = atom()
clear/0 | Equivalent to clear(default). |
clear/1 | Unregisters all collectors. |
collect/2 |
Calls Callback for each collector with two arguments:
Registry and Collector . |
collector_registeredp/1 | Equivalent to collector_registeredp(default, Collector). |
collector_registeredp/2 | Checks whether Collector is registered. |
collectors/1 |
Returns collectors registered in Registry . |
deregister_collector/1 | Equivalent to deregister_collector(default, Collector). |
deregister_collector/2 | Unregisters a collector. |
exists/1 |
Tries to find registry with the Name . |
register_collector/1 | Equivalent to register_collector(default, Collector). |
register_collector/2 | Register a collector. |
register_collectors/1 | Equivalent to register_collectors(default, Collectors). |
register_collectors/2 | Registers collectors list. |
clear() -> ok
Equivalent to clear(default)
.
clear(Registry::prometheus_registry:registry()) -> ok
Unregisters all collectors.
collect(Registry, Callback) -> ok
Registry = prometheus_registry:registry()
Callback = collect_callback()
Calls Callback
for each collector with two arguments:
Registry
and Collector
.
collector_registeredp(Collector) -> boolean()
Collector = prometheus_collector:collector()
Equivalent to collector_registeredp(default, Collector)
.
collector_registeredp(Registry, Collector) -> boolean()
Registry = prometheus_registry:registry()
Collector = prometheus_collector:collector()
Checks whether Collector
is registered.
collectors(Registry::prometheus_registry:registry()) -> [Collector::prometheus_collector:collector()]
Returns collectors registered in Registry
.
deregister_collector(Collector::prometheus_collector:collector()) -> ok
Equivalent to deregister_collector(default, Collector)
.
deregister_collector(Registry::prometheus_registry:registry(), Collector::prometheus_collector:collector()) -> ok
Unregisters a collector.
exists(Name) -> Result
Name = atom() | iolist()
Result = boolean() | atom()
Tries to find registry with the Name
.
Assumes that registry name is always an atom.
If Name
is an atom ets:lookup/2
is used
If Name
is an iolist performs safe search (to avoid interning
atoms) and returns atom or false. This operation is O(n).
register_collector(Collector::prometheus_collector:collector()) -> ok
Equivalent to register_collector(default, Collector)
.
register_collector(Registry::prometheus_registry:registry(), Collector::prometheus_collector:collector()) -> ok
Register a collector.
register_collectors(Collectors::[prometheus_collector:collector()]) -> ok
Equivalent to register_collectors(default, Collectors)
.
register_collectors(Registry::prometheus_registry:registry(), Collectors::[prometheus_collector:collector()]) -> ok
Registers collectors list.