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.
If user dont have database called postgres then you can get broken exporter.
- Start posgresql which doesnt have database called "postgres"
- Try add this postgresql with pmm-admin
- Exporter doesnt work.
- Add field in AddPostgreSQLServiceRequest in services.proto (PMM repo).
- Add field in AddPostgreSQLRequest in postgresql.proto (PMM repo).
- Add flag (PMM Admin repo).
- Use this field in postgresql.go, services.go, converters.go, service_helpers.go (PMM Managed repo).
- Use this field in function New in pgstatstatements.go, pgstatmonitor.go (PMM Agent repo).