DISCARD ALL is the query that is executed by PgBouncer in order to sanitise a database session before assigning it to another client. If you see this query in pg_stat_activity and status of the session is idle, most probably it is ok. Probably what you see is the last executed query for the session. And the session is idle and waiting to be assigned to a client. :)
I could see queries like DISCARD ALL is idle for more than 5minutes (we are using pgbouncer).
Why is it idle for more than 5mns? I read about pgbouncer and could not understand this thing. If resetting a connection using query becomes one idle connection, I don't understand the pooling system here