Skip to content

Plugin inputs.postgresql has a breaking change on telegraf v1.19.0 when the host is a unix socket path #9472

@jegj

Description

@jegj

Relevant telegraf.conf:

[[inputs.postgresql]]
	fielddrop = ["datid"]
	address = "host=/var/run/postgresql/.s.PGSQL.5432 sslmode=disable dbname=postgres"
	ignored_databases = ["postgres", "template0", "template1"]

System info:

Telegraf version: 1.19.0
OS: Ubuntu 20.04

Steps to reproduce:

  1. Install or upgrade to Telegraf 1.19.0
  2. Restart the service

After this upgrade, I am getting an error message related to the socket connection. The previous configuration block works on Telegraf v1.18.3 or less

Expected behavior:

Telegraf should work without problems, reporting the metrics without problems.

Actual behavior:

Telegraf cannot report metrics related to inputs.postgresql

Additional info:

2021-07-06T20:56:00Z E! [inputs.postgresql] Error in plugin: failed to connect to `host=/var/run/postgresql/.s.PGSQL.5432 user=telegraf database=postgres`: dial error (dial unix /var/run/postgresql/.s.PGSQL.5432/.s.PGSQL.5432: connect: not a directory)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/postgresqlbugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions