How it works...
If we already applied the Installing and configuring Telegraf recipe, the first portion of the configuration probably looks familiar. We define a connection string and set address so our perf_mon user can connect and retrieve metrics. As before, we use outputaddress to provide a convenient system alias so we can find these statistics later. We also set max_lifetime to 0s for persistent connections and databases to pgbench so we can focus on our primary database.
But that was something we already knew how to do. The exciting part lies within the inputs.postgresql_extensible.query sections. Telegraf will execute each of the queries we define every 10 seconds by default so we'll have a continuous stream of information. We already ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access