Prerequisites
- MySQL 5.7+ (8.0+ recommended for full
performance_schemasupport) - Network access from the HealOps environment to your MySQL instance
- A read-only user with access to
information_schemaandperformance_schema
Setup
Option 1: Interactive CLI
Option 2: Environment variables
Add to your.env:
Option 3: Persistent store
Integrations are automatically persisted to~/.config/healops/integrations.json:
Creating a read-only user
performance_schema is enabled by default in MySQL 5.7+. Slow query data will not be available if it has been explicitly disabled in my.cnf.Investigation tools
When HealOps investigates a MySQL-related alert, five diagnostic tools are available:Server status
Retrieves version, uptime, connection counts (current, running, max used), query rates, and InnoDB buffer pool hit ratio and deadlock counts. Useful for spotting connection saturation, high deadlock rates, or poor buffer pool efficiency.Current processes
Lists active queries running longer than a configurable threshold (default 1 s), excluding sleeping connections. Surfaces long-running queries and lock contention that may be blocking other operations.Replication status
Reports replica IO and SQL thread health, seconds behind source, and last replication error. UsesSHOW REPLICA STATUS (MySQL 8.0.22+) with automatic fallback to SHOW SLAVE STATUS for older versions. Returns a note if the server is not configured as a replica.
Slow queries
Readsperformance_schema.events_statements_summary_by_digest to surface queries with the highest average execution time. Results include call count, average/total/min/max execution time (in ms), rows examined, rows sent, and full-table scan indicators.
Slow query data requires
performance_schema to be enabled (performance_schema=ON in my.cnf). This is the default in MySQL 5.7+.Table statistics
Returns row count estimates, data size, and index size for all base tables in the target database, sourced frominformation_schema.TABLES. Results are ordered by total size descending.
Verify
Troubleshooting
Security best practices
- Use a dedicated read-only user — avoid root credentials for monitoring.
- Enable SSL (
MYSQL_SSL_MODE=required) in production environments. - Restrict the user to specific hosts rather than
'%'where possible. - Store credentials in
.env, never in source code. - Rotate credentials periodically.
Tracer