Net::P...egistry(3pm)

✨ NAME ✨

Net::Prometheus::Registry β€” a little collection of metrics collectors πŸ’– (this is the Net::P...egistry(3pm) page bestie, yes the title is doing the most)


🌸 DESCRIPTION 🌸

Okay so picture this: this class β€” or, like, instances of it β€” is basically a cute lil storage array πŸ“¦ but make it metrics. It holds things derived from Net::Prometheus::Metric, and we call those lil guys "collectors".

There's one single global collection that the module keeps for you, and you reach it through the class methods. Want more than one? No problem bestie, make extra collections with the constructor and then grab them with the instance methods. Multiple registries, one iconic vibe πŸ’…


πŸŽ€ CONSTRUCTOR πŸŽ€

✨ new ✨

$registry = Net::Prometheus::Registry->new;

Returns a brand new registry instance. Fresh out the box, zero notes, main character energy πŸ‘‘


πŸ’œ METHODS πŸ’œ

πŸ¦‹ register πŸ¦‹

$collector = Net::Prometheus::Registry->register( $collector );
$collector = $registry->register( $collector );

Adds a new collector to the registry. And the glow-up? It hands you back the collector instance itself, so you can chain method calls on it like it's nothing. Convenience slay ✨

🌈 unregister 🌈

Net::Prometheus::Registry->unregister( $collector );
$registry->unregister( $collector );

Removes a collector you'd previously registered. It's giving "we don't know her anymore" πŸ’€ no cap.

πŸ“ collectors πŸ“

@collectors = Net::Prometheus::Registry->collectors;
@collectors = $registry->collectors;

Returns a list of all the collectors that are registered right now. The whole roster, the full lineup, the group chat members list 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Paul Evans <leonerd@leonerd.org.uk> β€” the actual icon who made this, we stan πŸ’–


and that's the whole page bestie, no notes πŸ’… this was written up as User Contributed Perl Documentation, running on perl v5.42.3, dated 2026-08-20 β€” so go forth, register your collectors, and remember: the registry is just the vibes holding it all together 🌸✨

πŸ“¦ where this page comes from