Plumbr Universal Agent supports detecting PostgreSQL (8+) and MySQL (5.5+) queries as bottlenecks. These are detected by analyzing network traffic. Monitoring TLS-encrypted SQL connections is supported if the SQL client library uses OpenSSL for handling TLS.
The agent collects the query text, server address, server version and database name for each query. Only query text is used for bottleneck name, other information is only visible when looking at a specific query in single transaction view. The query duration is the time between when the first byte of the query was written to the network socket and when the last byte of the result (or error) was received. The time to initiate the SQL connection is not included in the query duration.
Each individual query longer than the bottleneck threshold (1 second) is registered as a bottleneck. If the combined duration of all queries below the bottleneck threshold in the same API call is longer than the threshold, then a multiple queries bottleneck is registered. For MySQL, if the duration between the server signalling that query is finished and the time when the last result byte was received exceeds the bottleneck threshold, this is created as a separate additional bottleneck which has “Processing” prefix instead of “Querying”. In that case, the “Querying” bottleneck is only created if the duration without result processing time exceeds the bottleneck threshold.