PostgreSQL is an open source object-relational database system.
The PostgreSQL monitoring extension captures metrics from a PostgreSQL database and displays them in the AppDynamics Metric Browser.
Before the extension is installed, the prerequisites mentioned here need to be met. Please do not proceed with the extension installation if the specified prerequisites are not met.
<task-arguments> <argument name="config-file" is-required="true" default-value="monitors/PostgreSQLMonitor/config.yml" /> </task-arguments>
Configure the extension by editing the config.yml file in
<MachineAgentHome>/monitors/PostgreSQLMonitor/. The metricPrefix of the extension has to be configured as specified here. Please make sure that the right metricPrefix is chosen based on your machine agent deployment, otherwise this could lead to metrics not being visible in the controller.
servers. Also specify the databases that have to be monitored. You can specify multiple servers in the same config.yml file.
When using ipv6 address set
servers: - displayName: "Local cluster" host: "127.0.0.1" useIpv6: "false" port: "5432" user: "" password: "" encryptedPassword: "" # optionalConnectionProperties: # connectTimeout: 100 # tcpKeepAlive: true databases: ... - displayName: "Local cluster" host: "::1" useIpv6: "true" port: "5432" user: "" password: "" encryptedPassword: "" databases: ...
useIpv6: "false". Additional connection properties can be set using
optionalConnectionProperties, you can refer here for all connection parameters.
databases: - dbName: "test" queries: ...
The name of the metric displayed on the Metric Browser will be the "name" value that is specified in columns.
queries : You can add multiple queries under this field, each query configured will consist of the following
Example, Consider the below query for server
databases: - dbName: "test" queries: # Add where clauses to query to filter databases - name: "Database Stats" serverLvlQuery: "true" queryStmt: "SELECT datname, numbackends FROM pg_stat_database" # the columns are the metrics to be extracted columns: - name: "datname" type: "metricPath" - name: "numbackends" type: "metricValue" properties: alias: "Number of connections" aggregationType: "OBSERVATION" timeRollUpType: "AVERAGE" clusterRollUpType: "INDIVIDUAL"
The above query will return 1 metric, with metric path -
Custom Metrics|Local Cluster|Database Stats|<datname>|Number of connections. Since the above query has
serverLvlQuery: true dbName won't be a part of the metric path.
Consider the below query for server
databases: - dbName: "test" queries: - name: "Table Stats" serverLvlQuery: "false" # add where clause to the query to filter tables queryStmt: "SELECT relname, seq_scan, seq_tup_read FROM pg_stat_user_tables where relname = 'myTable'" columns: - name: "relname" type: "metricPath" - name: "seq_scan" type: "metricValue" properties: alias: "Sequential Scans" delta: "true" aggregationType: "OBSERVATION" timeRollUpType: "AVERAGE" clusterRollUpType: "INDIVIDUAL" - name: "seq_tup_read" type: "metricValue" properties: alias: "Tuples fetched by Sequential Scans" delta: "true" aggregationType: "OBSERVATION" timeRollUpType: "AVERAGE" clusterRollUpType: "INDIVIDUAL"
Assume that this query returns -
The above query will return 2 metrics-
Custom Metrics|Local Cluster|test|Table Stats|relname|Sequential Scans = 10 Custom Metrics|Local Cluster|test|Table Stats|relname|Tuples fetched by Sequential Scans = 200
Use the following formula for calculating
numberOfThreads = for each server (1 + number_of(databases)). For example if you have 1 server and 2 databases then numberOfThreads = 1 + 2 = 3
Please visit this page to get detailed instructions on configuring Metric Path Character sequence replacements in Extensions.
Please visit this page to get detailed instructions on automatic dashboard upload with extension.
Please visit here page to get detailed instructions on
Please visit this page to get detailed instructions on password encryption. The steps in this document will guide you through the whole process.
Workbench is an inbuilt feature provided with each extension in order to assist you to fine tune the extension setup before you actually deploy it on the controller. Please review the following document for how to use the Extensions WorkBench
Please follow the steps listed in the extensions troubleshooting document in order to troubleshoot your issue. These are a set of common issues that customers might have faced during the installation of the extension. If these don't solve your issue, please follow the last step on the troubleshooting-document to contact the support team.
If after going through the Troubleshooting Document you have not been able to get your extension working, please file a ticket and add the following information.
Please provide us with the following for us to assist you better:
DEBUGlogging by changing the level values of the following logger elements from
<logger name="com.singularity"> <logger name="com.appdynamics">
For any support related questions, you can also contact email@example.com.
Always feel free to fork and contribute any changes directly via GitHub.
|Controller Compatibility||4.3.x or Later|
|Postgres Version Support||9.4 or later|