Code

Update postgresql.c
authordaniacs <daniacs@gmail.com>
Fri, 20 Oct 2017 16:36:12 +0000 (14:36 -0200)
committerGitHub <noreply@github.com>
Fri, 20 Oct 2017 16:36:12 +0000 (14:36 -0200)
A simple way collectd to identify itself to pg_stat_activity view.

src/postgresql.c

index 3b702aeef83491d590a631e142f37fec856151c1..b122dfe5397d53144026b0458c783517e57a2f61 100644 (file)
@@ -340,6 +340,7 @@ static int c_psql_connect(c_psql_database_t *db) {
   C_PSQL_PAR_APPEND(buf, buf_len, "sslmode", db->sslmode);
   C_PSQL_PAR_APPEND(buf, buf_len, "krbsrvname", db->krbsrvname);
   C_PSQL_PAR_APPEND(buf, buf_len, "service", db->service);
+  C_PSQL_PAR_APPEND(buf, buf_len, "application_name", "collectd_postgresql");
 
   db->conn = PQconnectdb(conninfo);
   db->proto_version = PQprotocolVersion(db->conn);