Not the answer you need?
Register and ask your own question!
Many Forum changes were implemented on Tue 22 Sep. Read about new Ranks, Scoring, and Reactions.
Email [email protected] for any comments or concerns.

postgres_exporter not working (PMM Server/Agent 2.5)

AlexBAlexB Current User Role Contributor
I use to monitor some mysql instances with no problems, but i encounter an issue with posgresql servers (12), pmm agent complains about a malformed dsn :
Apr 16 11:57:44 postgres.test postgres[81415]: [8-1] 2020-04-16 11:57:44.214 CEST [81415] LOG:  connection received: host=192.168.0.2 port=40606
Apr 16 11:57:44 postgres.test postgres[81415]: [9-1] 2020-04-16 11:57:44.216 CEST [81415] LOG:  connection authorized: user=pmm_user database=postgres
Apr 16 11:57:44 postgres.test pmm-agent: #033[36mINFO#033[0m[2020-04-16T11:57:44.223+02:00] time="2020-04-16T11:57:44+02:00" level=info msg="Starting postgres_exporter (version=, branch=, revision=)" source="postgres_exporter.go:1457"  #033[36magentID#033[0m=/agent_id/68a5e0df-8eac-46c7-a740-831450a3e5f4 #033[36mcomponent#033[0m=agent-process #033[36mtype#033[0m=postgres_exporter
Apr 16 11:57:44 postgres.test pmm-agent: #033[36mINFO#033[0m[2020-04-16T11:57:44.223+02:00] time="2020-04-16T11:57:44+02:00" level=info msg="Build context (go=go1.13.8, user=, date=)" source="postgres_exporter.go:1458"  #033[36magentID#033[0m=/agent_id/68a5e0df-8eac-46c7-a740-831450a3e5f4 #033[36mcomponent#033[0m=agent-process #033[36mtype#033[0m=postgres_exporter
Apr 16 11:57:44 postgres.test pmm-agent: #033[36mINFO#033[0m[2020-04-16T11:57:44.223+02:00] time="2020-04-16T11:57:44+02:00" level=error msg="Error opening connection to database (postgres://pmm_user:[email protected]:5432/postgres?connect_timeout=1&sslmode=disable): malformed dsn \"connect_timeout=1 dbname=postgres host=192.168.0.2 password=*** port=5432 sslmode=disable user=pmm_user\"" source="postgres_exporter.go:1396"  #033[36magentID#033[0m=/agent_id/68a5e0df-8eac-46c7-a740-831450a3e5f4 #033[36mcomponent#033[0m=agent-process #033[36mtype#033[0m=postgres_exporter
RépondreTransférer

Comments

  • adivinhoadivinho Percona Percona Staff Role
    Hi Alex,
    It looks like the issue is related to a wrong credential. Could you check postgres logs?

    We have tested pmm client with the latest PostgreSQL.
    # /usr/local/pgsql/bin/psql -V
    psql (PostgreSQL) 12.2
    #
    [[email protected] ec2-user]# pmm-admin add postgresql --username="ec2-user" --port=5433 postgres-12.2
    PostgreSQL Service added.
    Service ID  : /service_id/b578e924-c4e2-466a-ab21-23ff24d46ebd
    Service name: postgres-12.2
    # pmm-admin list | grep postgres-12.2
    PostgreSQL    postgres-12.2        127.0.0.1:5433    /service_id/b578e924-c4e2-466a-ab21-23ff24d46ebd
  • AlexBAlexB Current User Role Contributor
    pmm-admin list shows me a connected status for agent and a runnning status for all exporters.
    In the logs i previously posted :
    Apr 16 11:57:44 postgres.test postgres[81415]: [8-1] 2020-04-16 11:57:44.214 CEST [81415] LOG:  connection received: host=192.168.0.2 port=40606
    Apr 16 11:57:44 postgres.test postgres[81415]: [9-1] 2020-04-16 11:57:44.216 CEST [81415] LOG:  connection authorized: user=pmm_user database=postgres
    So it does not seem to be a credential problem.
    Ty.
  • adivinhoadivinho Percona Percona Staff Role
    Are you able to establish a connection by using the connection URI from logs?
    e.g.
    # /usr/local/pgsql/bin/psql -Atx "postgres://pmm_user:[email protected]:5433/postgres?connect_timeout=1&sslmode=disable" -c 'select current_date'
    current_date|2020-04-22

  • AlexBAlexB Current User Role Contributor
    Yes it is working, i can establish a connection by using the connection URI from logs. But i cant check the password effectively sent as it appears as PASSWORD_REMOVED in the logs.
  • adivinhoadivinho Percona Percona Staff Role
    Hi Alex,
    Could you raise a bug report in our Jira system with all related information? It's required to reproduce the issue on our side.
  • AlexBAlexB Current User Role Contributor
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.