How it works...
Believe it or not, the first step is to create a configuration file for the local PostgreSQL installation so we can monitor every database that looks interesting. For now, we'll focus on a previously created pgbench database because it's easy to simulate database activity here.
There are really only four configuration elements we must actually set. We begin with address, which is a standard PostgreSQL connection string, and we've specified our pgha1 server. Related to this is outputaddress, which acts as a label in any monitoring display and lets us identify the system specifically instead of using a default generated name.
Then, we set max_lifetime to 0s, which indicates we want Telegraf to remain connected to PostgreSQL ...
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