# Postgres QAN agent in waiting status

**URL:** <https://forums.percona.com/t/postgres-qan-agent-in-waiting-status/24819>\
**Category:** PMM 2.x\
**Tags:** pmm, postgres\
**Created:** [August 30, 2023, 5:14pm UTC](https://forums.percona.com/t/postgres-qan-agent-in-waiting-status/24819 "2023-08-30T17:14:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chinthakunta\_Sumanth](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/chinthakunta_sumanth/32/12513_2.png) [@Chinthakunta\_Sumanth](https://forums.percona.com/u/Chinthakunta_Sumanth)\
**Post date:** [August 30, 2023, 5:14pm UTC](https://forums.percona.com/t/postgres-qan-agent-in-waiting-status/24819/1 "2023-08-30T17:14:45Z")

</div>

## Description:

The goal was to deploy PMM 2.x for monitoring AWS Aurora MySQL and Postgres instances. I have deployed PMM server on EKS using helm chart with below commands.

```auto
helm repo add percona https://percona.github.io/percona-helm-charts/
helm repo update
helm install pmm --set secret.create=true --namespace=pmm percona/pmm

```

Also ensured that the service account which runs the pod has policies for RDS discovery and cloudwatch log access as given at [Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/aws.html#creating-a-policy)

**NOTE:** The enhanced monitoring and performance insights have both been enabled on all Aurora MySQL and Postgres instances.

I have tried to add MySQL first using settings \> Inventory \> Add service \> Add RDS instance which worked. I have used user and password auth for the role which had rds super user access.

I tried same user on Postgres and wasn’t able to see the QAN logs. The agent in the Service for QAN says waiting forever.

I have also tried checking logs of pmm agent using Help \> PMM Logs , which creates a zip with all logs. The agent logs had following statements for the QAN postgres agent for service i have added.

```auto
Sending status: STARTING.                                                              
sql: no rows in result set                                     
Sending status: WAITING.   

```

So i connected to respective postgres db using pgsql and checked that i wasn’t able to find view named pg\_stat\_statements.

**NOTE:** I do have the idea that i need to enable pg\_stat\_statements extensions as mentioned at [Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/postgresql.html#configure). I remember i read in some doc that once performance insights is enabled, Aurora manages it. So not sure if i should mess things up. But i do see that pg\_stat\_statements is already loaded up in shared\_preload\_libraries and everything else is engine default.

## Steps to Reproduce:

Deploy using helm chart with default values file.

## Version:

PMM version - 2.38.0  
Aurora PostgresSQL - 11.16

## Logs:

```auto
Sending status: STARTING.                                                              
sql: no rows in result set                                     
Sending status: WAITING.   

```

## Expected Result:

Expected to see queries under QAN tab.

## Actual Result:

The postgres QAN agent is in waiting state.

---

<div class="post-metadata">

**Author:** ![Chinthakunta\_Sumanth](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/chinthakunta_sumanth/32/12513_2.png) [@Chinthakunta\_Sumanth](https://forums.percona.com/u/Chinthakunta_Sumanth)\
**Post date:** [August 30, 2023, 6:17pm UTC](https://forums.percona.com/t/postgres-qan-agent-in-waiting-status/24819/2 "2023-08-30T18:17:21Z")

</div>

Apologies, i have raised this question a little too early. I think my hunch was right.

The QAN agent was in waiting state because as PMM logs say , there were no pg\_stat\_statements view in my RDS and thereby no records to export.

Running create extension as per doc worked. Tested this on test RDS instance.

Doc link - [PostgreSQL - Percona Monitoring and Management](https://docs.percona.com/percona-monitoring-and-management/setting-up/client/postgresql.html#configure)

```auto
CREATE EXTENSION pg_stat_statements SCHEMA public;

```

Once i created this, the agent went into Running state and i could see the queries. I have raised a AWS support ticket to check if doing this manually affects performnace insights in any way.
