How does SQLEye capture queries?
SQLEye asks the database server what it is doing. For PostgreSQL it turns on statement logging in JSON format and tails the log. For MySQL it reads performance_schema statement history. There is no proxy, agent or library involved, and capture is off by default for each instance.
On PostgreSQL, SQLEye sets log_min_duration_statement to 0 while capture is on and back to -1 when it is off, applying the change with a configuration reload instead of a restart. On MySQL, it polls the statement history table at a short interval; if more statements arrive between polls than the history holds, some can be missed.
Each event carries the SQL, duration, connection and, on MySQL, rows examined. SQL text is truncated at 8 KB per event. See Capture for the mechanics and Engines for the per-engine differences.
SQLEye is developed and maintained by CodeROG. This page is also available as Markdown.