pg_metricus
pg_metricus_c · Sends custom metrics from PL/pgSQL code to socket-based aggregators such as Brubeck or Graphite.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100438 | pg_metricus | pg_metricus_c | 1.0 | STAT | MIT | C |
Usage
Sources:
pg_metricus sends application-formatted metrics from SQL or PL/pgSQL to an IPv4 UDP endpoint such as Brubeck or Graphite. It provides transport only: the caller must construct the exact line protocol expected by the receiver.
Core Workflow
Configure the destination address and port, reload PostgreSQL configuration, and install the extension in a chosen schema.
The endpoint settings can be changed with a configuration reload; the extension does not require preloading.
SQL Object and Delivery Semantics
send_metric(text) RETURNS voidsends the supplied bytes as one UDP datagram.
Version 1.0 accepts only a numeric IPv4 address because its C implementation uses inet_pton with AF_INET. UDP provides no acknowledgement or retry, and the function does not make delivery transactional: a datagram already sent remains sent even if the surrounding database transaction later aborts. Avoid placing secrets in metric text, and treat successful return as a local send attempt rather than confirmation that the collector stored the metric.