Obtaining your PostgreSQL credentials
Your PostgreSQL credentials are needed for Avenue to connect to your PostgreSQL database.
Definitions
Database Name: The name of the specific database within the PostgreSQL server that you are trying to access.
Host: The IP address or hostname of the server where your PostgreSQL is running.
Username: The username you (or your database admin) set up when PostgreSQL was installed.
Password: The password for the above user.
Port: The port where PostgreSQL is running. The default is 5432.
Connection String: A single string that combines the above information for easy access.
How to Procure Credentials
Identifying an Existing Database Name: If the database already exists and you're attempting to find the name, you can retrieve the list of databases in PostgreSQL by using the following command in the PostgreSQL interactive terminal (psql):
Switch to the
postgres
user (or another user with similar superuser privileges):sudo -u postgres psql
List all databases:
\l
Identify the Host: This is usually the IP address or hostname of the server where your PostgreSQL is running.
Determine the Username: This is the username that was set up when PostgreSQL was installed. The default superuser for Postgres is usually postgres.
Determine the Password: This is the password for the above user. If you've forgotten the password, it will need to be reset by a user with superuser privileges.
Identify the Port: The default port for PostgreSQL is 5432. However, this may have been changed during setup or if running multiple instances of PostgreSQL.
Using a Connection String
The connection string combines all the previous information into a single string. The structure for a PostgreSQL connection string is:
postgresql://username:password@localhost:5432/mydatabase
Replace username
, password
, localhost
, 5432
, and mydatabase
with your actual credentials and database name.
Adding PostgreSQL as Datasource
💡Please allow Avenue to connect to your database by allow-listing our IP addresses: 3.217.246.91, 52.55.137.145
Select
Data Sources
and click+ Add New Connection
.There are two options to add PostgreSQL as a datasource: Manual Input or by using a Connection String.
When adding them manually you will input the credentials previously collected into their related fields
If using a Connection String is preferred simply enter the string into the
Once your credentials are added select
Connect Database
Connecting a monitor to your PostgreSQL data
Once you have connected your PostgreSQL instance you can use it in your monitors by heading to the Select the Data
section of the monitor create or edit form and select it from the database dropdown.