Metric...r::Tee(3pm)

πŸ’– Metrics::Any::Adapter::Tee β€” the polyamorous adapter πŸ’–

okay so bestie, this is a User Contributed Perl Documentation page for Metrics::Any::Adapter::Tee, and it is literally the adapter that says "why pick one when you can have all of them". no cap. let's get into it πŸ’…


✨ NAME ✨

Metrics::Any::Adapter::Tee β€” send metrics to multiple adapters πŸ¦‹

like, multiple. at once. at the same time. iconic behaviour honestly.


🌸 SYNOPSIS 🌸

use Metrics::Any::Adapter 'Tee',
   "Prometheus",
   [ "File", path => "metrics.log" ],
   "Statsd";

see how we're just listing them out? three adapters, one Tee, zero drama. the way that this just works 🫢


πŸ‘‘ DESCRIPTION πŸ‘‘

This Metrics::Any adapter type acts as a container for multiple other adapters, allowing an application to report its metrics via multiple different mechanisms at the same time.

fr fr. it's giving group chat energy β€” every metric gets sent to everyone. no one gets left on read πŸ“¬βœ¨


πŸŽ€ ARGUMENTS πŸŽ€

Each value passed in the import list should either be an adapter type string or an array reference containing the name and additional arguments.

so like, two flavours, pick your fighter:

  • a string β€” just the adapter type name, plain and simple πŸ’«
  • an array reference β€” [ name, additional, arguments ], when you've got more to say πŸ’¬

Adapters specified by string are split in the same way as Metrics::Any::Adapter splits the METRICS_ANY_ADAPTER environment variable; namely by parsing optional arguments after a colon, separated by commas or equals signs. E.g.

"File:path=metrics.log"

would be equivalent to the version given in the synopsis above.

lowkey obsessed with how a colon and some equals signs can carry the whole vibe of an array ref. the string form is a shortcut, not a different thing β€” same destination, cuter route 🧚

πŸ’œ AUTHOR πŸ’œ

Paul Evans <leonerd@leonerd.org.uk>

the actual main character. we stan 🌟


and that's the whole page bestie, no filler, every detail preserved, we ate and left no crumbs πŸ“

signing off with the receipts: this was perl v5.36.0, dated 2023-09-29, and yes the doc header really does abbreviate the title to Metric...r::Tee(3pm) like that, we don't make the rules πŸ˜­πŸ’€

go forth and tee your metrics, queen πŸ‘‘βœ¨

πŸ“¦ where this page comes from