Connect a PostgreSQL instance
Connects a PostgreSQL instance so CostGraph can split its bill across the databases on it and the roles that use them. CostGraph logs in with a read-only login that needs the pg_monitor role, and checks the connection before saving: the login is refused when it cannot sign in or read usage statistics. instance_id is the instance’s resource ID on your cloud bill; its cost is split from that bill line, and an instance_id that matches several resources on the bill is refused. Every hour CostGraph reads each database’s size and activity, each role’s query time from pg_stat_statements when that extension is enabled in the database it logs in to, and key=value labels from COMMENT ON DATABASE and COMMENT ON ROLE, which become tags on the split cost. The split appears in cost queries and showback with layer=database. Warnings name what is unavailable, such as pg_stat_statements, or that the instance ID has no cost on the bill yet. They are also kept on the connection: the connection list shows them in warnings, refreshed by every hourly read, and a read that fails sets status error with the reason in last_sync_error. CostGraph Cloud can only reach public addresses and only connects with sslmode verify-full (the default there) or verify-ca, so the server’s certificate is checked before the password is sent; a self-hosted installation can reach private addresses and defaults to require. ca_certificate is an optional PEM CA certificate for instances whose certificate is signed by a private CA. The password is never returned.
Body
Connection settings