Skip to content

PostgreSQL address default value "local" instead of "localhost" #4872

@exhuma

Description

@exhuma

Relevant telegraf.conf:

[[inputs.postgresql]]
address = ""

System info:

  • Telegraf at commit 36193aea
  • postgresql version 10.5-0ubuntu0.18.04

Steps to reproduce:

  • set an empty address in telegraf.conf for that DB

Expected behavior:

  • DB connection should use the PostgreSQL default, which is the use of a local unix domain socket

Actual behavior:

  • The DB connection uses a TCP connection via localhost and disables SSL

Additional info:

This issue is a fairly low priority, but it got me stumped when playing around with telegraf. On my development box I don't need TCP connections to PostgreSQL and never enabled it. All my apps run locally using a unix-domain socket. This is the default config of PostgreSQL. All other PG clients I know of (including psql) will connect using the Unix domain socket when no DSN is specified.

I would expect telegraf to behave like any other PG client in it's default config.

Right now the DSN is hardcoded to localhost if an empty address is specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/postgresqlbreaking changeImprovement to Telegraf that requires changes to the plugin or agent; for minor/major releasesfeature requestRequests for new plugin and for new features to existing pluginsplugin/input1. Request for new input plugins 2. Issues/PRs that are related to input plugins

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions