Prometheus.Registry (Prometheus.ex v4.0.0)

View Source

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.

Summary

Functions

Unregisters all collectors.

Calls callback for each collector with two arguments: registry and collector.

Checks whether collector is registered.

Returns collectors registered in registry.

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).

Functions

clear(registry \\ :default)

Unregisters all collectors.

collect(registry \\ :default, callback)

Calls callback for each collector with two arguments: registry and collector.

collector_registered?(registry \\ :default, collector)

Checks whether collector is registered.

collectors(registry \\ :default)

Returns collectors registered in registry.

deregister_collector(registry \\ :default, collector)

Unregisters a collector.

exists(name)

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(registry \\ :default, collector)

Registers a collector.

register_collectors(registry \\ :default, collectors)

Registers collectors list.