Can't add PostgreSQL instances to PMM without `postgres` DB in PostgreSQL server

Description

The API and PMM Add Instance dashboard both assume that the Postgres instance to be added has a database called postgres. This is not alway true. For example, DigitalOcean DBaaS instances are created with a defaultdb database instead. The AddPostgreSQLService endpoint and the PMM Add Instance dashboard should both allow the user to specify the database name when adding a Postgres instance.

 

User impact:

If user dont have database called postgres then you can get broken exporter.

STR:

  1. Start posgresql which doesnt have database called "postgres"

  2. Try add this postgresql with pmm-admin

  3. Exporter doesnt work.

 

Suggested implementation:

  1. Add field in AddPostgreSQLServiceRequest in services.proto (PMM repo).

  2. Add field in AddPostgreSQLRequest in postgresql.proto (PMM repo).

  3. Add flag (PMM Admin repo).

  4. Use this field in postgresql.go, services.go, converters.go, service_helpers.go (PMM Managed repo).

  5. Use this field in function New in pgstatstatements.go, pgstatmonitor.go (PMM Agent repo).

How to test

None

How to document

None

Attachments

3

Smart Checklist

Activity

Show:

Jira Bot December 2, 2021 at 11:56 AM

To:
CC:

Hi, I'm jira-bot, Percona's Jira automation tool. I've detected that someone from
Percona has made an edit to the Summary field of an issue that you reported.

I'm not sentient (yet) so I'm not sure whether the person fixed a typo, changed
a few words, or completely rewrote the text. In any case, it is Percona Engineering's
intention to make the Summary and Description of an issue as accurate as possible
so that we're fixing the actual problem you're encountering, and to avoid
misunderstandings about symptoms and causes.

If the current Summary does not accurately reflect the problem you are reporting,
or if you feel the change was otherwise inappropriate in some way, please add a
new comment explaining things and we'll address it as soon as we can.

This message will be added only once per issue, regardless of how many times
the Summary is edited.

message-code:summary-edited

Roma Novikov December 2, 2021 at 11:12 AM

 ,  I've forgot about documentation  (( 

can you  pls add  new flag  to 
https://github.com/percona/pmm-doc/blob/2.25.0/docs/details/commands/pmm-admin.md

Former user November 22, 2021 at 1:04 PM

Flag added

Waiting for 

Roma Novikov October 29, 2021 at 3:41 PM

 Please check  . I think it's very related to this issue (and a possible bug we can get in this issue )

Roma Novikov October 29, 2021 at 9:41 AM

Note:  this DB name must be used in all cases we connect to  PG like: 

  • QAN

  • Exporter

  • STT checks  / Advisors

  • backups (in future)

  • ???

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Planned Version/s

Fix versions

Story Points

Sprint

Affects versions

Smart Checklist

Created November 12, 2020 at 5:30 PM
Updated March 6, 2024 at 3:40 AM
Resolved November 29, 2021 at 12:45 PM