Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-9541

PostgreSQL exporter not working with --socket

Details

    • 2
    • Yes
    • Yes
    • PMM Core
    • Hide
      • Setup postgres monitoring with using --socket option
      • Verify that monitoring is ok in PMM
      • Connect to the postgres and create a new database, e.g. `CREATE DATABASE contrib_regression;`
      • Verify that metrics are still available in PMM and there are no error in logs.
      Show
      Setup postgres monitoring with using --socket option Verify that monitoring is ok in PMM Connect to the postgres and create a new database, e.g. `CREATE DATABASE contrib_regression;` Verify that metrics are still available in PMM and there are no error in logs.

    Description

      pmm-agent is not working with --socket:

      Feb 02 00:05:00 agustin-gallego-node1 pmm-agent[3590]: INFO[2022-02-02T00:05:00.238+00:00] time="2022-02-02T00:05:00Z" level=info msg="Established new database connection to \"pmm_user:5432\"." source="postgres_exporter.go:913"  agentID=/agent_id/615928d9-cd34-4eaa-8cdf-13c6cc6d25c2 component=agent-process type=postgres_exporter
      Feb 02 00:05:00 agustin-gallego-node1 pmm-agent[3590]: INFO[2022-02-02T00:05:00.240+00:00] time="2022-02-02T00:05:00Z" level=error msg="Error opening connection to database (postgres://postgres:PASSWORD_REMOVED@pmm_user?connect_timeout=1&host=%!F(MISSING)var%!F(MISSING)run%!F(MISSING)postgresql%!F(MISSING)&sslmode=disable): dial tcp: lookup pmm_user on 10.124.33.1:53: no such host" source="postgres_exporter.go:1605"  agentID=/agent_id/615928d9-cd34-4eaa-8cdf-13c6cc6d25c2 component=agent-process type=postgres_exporter 

      It interesting to see the connection string in particular:

      postgres://postgres:PASSWORD_REMOVED@pmm_user?connect_timeout=1&host=%!F(MISSING)var%!F(MISSING)run%!F(MISSING)postgresql%!F(MISSING)&sslmode=disable 

      To reproduce try to add an exporter with a command like:

      pmm-admin add postgresql --username='postgres' --password='secret' --socket=/var/run/postgresql/ postgres 

      PostgreSQL version 13.2 used, but I don't think that has much to do. I tested with Nickolay's anydbver:

      https://github.com/ihanick/anydbver

      With the command:

      ./anydbver deploy pmm node1 pg:13.2 pmm-client pmm-server:default 

       

      Attachments

        Issue Links

          Activity

            People

              oleksii.kysil Oleksii Kysil (Inactive)
              agustin.gallego Agustín Gallego
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Smart Checklist