PostgreSQL agent
Prerequisites
- For prerequisite checks for agent installation, see Prerequisite checks for agent installation.
- URL/IP of the SixthSense collector (your tenant URL, which will be provided by Customer Support).
- Access token from the SixthSense portal. For accessing the token, see Accessing your Access Token under Getting started with the Observability Portal.
- PostgreSQL agent version "latest".
- Package token to download agent (provided by the onboarding team).
- For information about supported agent versions and framework, see Supported agents.
Downloading the agent version 5.2.0 (latest)
For Windows and Linux based servers, use the following link.
Configuring the PostgreSQL agent
Create a config.yaml file in the same directory.
Create a procedure if isQueryExtension=true to get all historic queries=>.
note
Use either the sql port or socket.
To enable the query on the postgres database, perform the following:
- Login to Postgres DB: psql -U postgres.
- Create a Database and table.
- Run the long running query inside this table.
To create a read-only new user in PostgreSQL use the following commands.
PostgreSQL QEP (Query Execution Plan) Prerequisites Setup
PostgreSQL QEP setup requires enabling necessary extensions, updating configuration, and restarting the service. First, install the required extensions if not exists:
Next, verify that the extensions are properly installed using:
After verification, update the PostgreSQL configuration file (postgresql.conf) to preload the required libraries and configure query statistics tracking:
Once the configuration is updated, restart PostgreSQL to apply the changes:
Finally, validate the configuration after restart using:
This setup ensures that PostgreSQL is properly configured for query execution plan and performance analysis using pg_stat_statements and pg_stat_kcache.
Running the agent
For Linux:
Use the following command to run the agent.
For Windows:
- Register DBM agent as a Service in Windows. Type in the following command in cmd:
Example:
Confirm whether the service is registered by opening Services and search for the Service Name with which you've registered.
Run the service by opening the Services again and look for Service name > Start or sc start <service_name>.
Example: sc start MeterAgent_postgres