Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(compute): Set default application_name for pgbouncer connections
When client specifies `application_name`, pgbouncer propagates it to the Postgres. Yet, if client doesn't do it, we have hard time figuring out who opens a lot of Postgres connections (including the `cloud_admin` ones). I haven't found this documented, but it looks like pgbouncer accepts standard Postgres connstring parameters in the connstring in the `[databases]` section, so put the default `application_name=pgbouncer` there. That way, we will always see who opens Postgres connections. I did tests, and if client specifies a `application_name`, pgboucner overrides this default, so it only works if it's not specified or set to blank `&application_name=` in the connection string. I think this is the last place we could potentially open some Postgres connections without `application_name`. Everything else should be either of two: 1. Direct client connections without `application_name`, but these should be strictly non`cloud_admin` ones 2. Some ad-hoc internal connections so if we will see spikes of unidentified `cloud_admin` connections, we will need to investigate it again. Fixes neondatabase/cloud#20948
- Loading branch information