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

πŸ’– Net::Prometheus::Types β€” the manual page (it shows up in your terminal as Net::P...:Types(3pm), but bestie, you and I both know her full name) πŸ’–

✨ NAME ✨

Net::Prometheus::Types β€” a collection of support structure types 🫢


🌸 SYNOPSIS 🌸

okay so here's the whole vibe in one go:

use Net::Prometheus::Types qw( Sample );

my $ob = Sample( variable => [], 123 );

print "The sample relates to a variable called ", $ob->varname;

πŸ¦‹ DESCRIPTION πŸ¦‹

This package is literally just a pile of simple little support structures that help out the other parts of the Net::Prometheus distribution. She's not the main character, she's the bestie holding everyone's bags. πŸ’…

Every single type gets exported as a constructor function, so you just call it and boom, you have a thing. ✨


πŸŽ€ TYPES πŸŽ€

⭐ Sample

This structure is one (1) individual value sample. It's the way she ties a numerical value to a named variable and a set of label values β€” iconic, honestly.

$sample = Sample( $varname, $labels, $value )
  • varname
$varname = $sample->varname

The string variable name. This is the basic name, okay β€” undecorated by label values, no extra garnish.

  • labels
$labels = $sample->labels

A reference to an even-sized ARRAY holding name/value pairs for the labels. And listen: the label values should be raw unescaped strings. fr fr.

  • value
$sample->value

The numerical value observed. The number. Periodt.

🌈 MetricSamples

This one is the whole crew β€” it represents all the samples made about a given metric, plus the metadata about the metric itself.

$samples = MetricSamples( $fullname, $type, $help, $samples )
  • fullname

A string giving the fullname of the metric.

  • type

A string, one of 'gauge', 'counter', 'summary' or 'histogram'. Pick one, bestie, those are the options. πŸŽ€

  • help

A string containing the descriptive help message text.

  • samples

A reference to an ARRAY containing individual Sample instances. It's giving "samples, all the way down".


πŸ‘‘ AUTHOR πŸ‘‘

Paul Evans <leonerd@leonerd.org.uk>


that's the whole page, no cap ✨ and for the cute little sign-off: this one's from perl v5.42.3, dated 2026-08-20, and it lives in the manual as Net::P...:Types(3pm). go forth and instrument everything, you absolute genius πŸ«ΆπŸ’–

πŸ“¦ where this page comes from