Monitor Readyset in PMM with Built In Prometheus Metrics
- Tibor Korocz
- 311 reads
Readyset’s built in metrics work with PMM, with a parser workaround, version matched dashboards and alerts for availability and database connectivity.

Readyset sits in the application’s query path, so its health and cache behavior matter alongside the database it fronts. Percona Monitoring and Management (PMM) can collect Readyset’s Prometheus metrics directly; there’s no separate exporter to install. The setup has one wrinkle: PMM’s initial connection check rejects duplicate metric names, even though its collector can ingest the data.
Metrics from Readyset
Readyset exposes Prometheus metrics at /metrics and a health endpoint at /health, served over HTTP on port 6034 by default. The port can be changed with --metrics-address. In the version tested, metrics were enabled by default. Older versions may require the --prometheus-metrics option, or PROMETHEUS_METRICS=true when running in Docker.
The test setup ran Readyset in a Docker container in front of MySQL 8.4. Applications connected to Readyset on port 3307, while PMM could scrape its metrics on port 6034. Readyset proxied queries it could not serve from cache to the upstream database.
One useful metric, readyset_query_log_execution_count, carries a database_type label. The value readyset identifies queries served by Readyset; upstream identifies queries passed to the database. Each series also includes a query_id, which can be matched to the IDs shown by SHOW CACHES and SHOW PROXIED QUERIES.
Cache mode affects which metrics are relevant. Recent Readyset versions create shallow caches by default: they keep query results for a time to live (TTL), then refresh them from the database. Deep caches instead use the database’s binary log, or PostgreSQL’s write ahead log (WAL), to apply changes incrementally. Readyset provides dashboards for both modes, and the two expose some different metrics.
The reported setup used Readyset stable-261022, MySQL 8.4 and PMM 3.10.0. Those version details matter when matching dashboard files and interpreting behavior.
Connect PMM to the metrics endpoint
On the Readyset host, PMM Client can register the endpoint as an external service with pmm-admin add external --service-name=readyset --listen-port=6034 --group=readyset. In the test, this command failed its connection check because two internal Readyset metrics collide after Prometheus name normalization.
The underlying names are readyset_query_status_cache.id_to_status.size and readyset_query_status_cache_id_to_status_size. Prometheus metric names cannot contain dots, so the dotted name is converted to underscores. That produces the same name as the second metric, leaving two type declarations for one metric name in the endpoint output. PMM Client’s parser rejects that response during the check, while PMM’s vmagent collector can still scrape it.
For this case, add the service with --skip-connection-check: pmm-admin add external --service-name=readyset --listen-port=6034 --group=readyset --skip-connection-check. The service can then appear in pmm-admin list even if the external exporter status is shown as Unknown. In the test, metrics arrived and PMM collected 113 Readyset metrics.
The --group=readyset option adds the label external_group="readyset" to collected metrics. That label makes it straightforward to select Readyset series in alert queries.
Choose dashboards that match the Readyset version
Readyset maintains Grafana dashboard JSON files in its own repository. Use files from a tag that matches the Readyset version in use; the tested setup used the stable-261022 dashboards. A dashboard hosted on Grafana.com dates from February 2024 and uses older metric names, so it may not fit a current installation.
Several dashboards are useful for routine operations:
- Operation (
ops.json) gives a high level view of query hit ratio, queries per second, connections, memory and uptime. - Adapter metrics (
adapter_metrics.json) separates cached and proxied query rates and p50 and p99 latency, and includes connections and query parsing errors. - Query Metrics (
query_overview.json) lists cached and proxied queries with query text, counts and latency. - Shallow Caching (
shallow_caching.json) tracks cache hits, misses and refreshes. - Replication Performance, Memory Usage and Evictions cover deep cache replication, memory consumption and cache evictions.
There are also dashboards for benchmarking, ProxySQL and Readyset internals, including perf_debugging.json. Those are less central to everyday monitoring. The Specific Query dashboard (query_specific.json) had panels that did not work in the test.
Two dashboards need a MySQL data source connected to Readyset itself. Query Metrics runs SHOW CACHES and SHOW PROXIED QUERIES; the Uptime panel runs SHOW READYSET STATUS. In PMM, name the data source DS_READYSET, matching the name expected by Readyset’s dashboards. The tested configuration connected to Readyset on port 3307; only MySQL was tested for this part.
When importing a dashboard into PMM, select Metrics for DS_PROMETHEUS. For Query Metrics, also select DS_READYSET for its MySQL data source. Then choose the Readyset deployment in the dashboard’s deployment selector. This value comes from Readyset’s DEPLOYMENT setting, which defaults to readyset.db when unset.

The Query Metrics dashboard combines two sources because Prometheus metrics contain query IDs, not query text. PMM gets the text from SHOW CACHES and SHOW PROXIED QUERIES, then uses the metrics for counts and latency. Readyset also offers a verbose query log mode that adds query text as a metric label, but that creates many more time series. Teams should weigh the convenience of that extra detail against the additional monitoring data it produces.


In the laptop test, a cached query averaged about 2 microseconds with a shallow cache and 4.5 microseconds with a deep cache. When the query missed the cache and went to MySQL, it averaged about 97 microseconds. These figures describe a small test, not a general performance guarantee; their practical value is showing how the dashboard can compare cached and proxied work in the same environment.
Alert on service and upstream health
PMM creates an up metric for each exporter. It is 1 when collection succeeds and 0 when it fails. To alert when Readyset metrics stop arriving, use the query max by (service_name, node_name) (max_over_time(up{external_group="readyset"}[1m])) and set the threshold to Is below 1. The example used a 30 second evaluation interval and a one minute pending period. Set no data handling to Alerting so a missing metrics stream, such as a stopped PMM Client, also raises an alert.
The max_over_time expression stays above zero if at least one collection succeeded during the preceding minute. A single slow scrape therefore won’t trigger this alert by itself.
A separate alert can track Readyset’s connection to its upstream database. Readyset checks that database every 10 seconds and exposes readyset_upstream_server_up, which becomes 0 when the upstream is unavailable. Use min by (service_name, server) (readyset_upstream_server_up{external_group="readyset"}) and set the threshold to alert below 1. For this rule, no data handling can remain Normal, since an outage of Readyset itself is covered by the first alert.
Both alerts fired within about two minutes in the test after the Readyset container was paused and MySQL was stopped; they returned to normal after both services were restarted. Deep cache users may also want to alert on readyset_replicator_replication_lag. Its units depend on the database and replication position: bytes for PostgreSQL and MySQL file based positions, and transactions for MySQL GTID.


Small dashboard adjustments
Readyset’s dashboards are built for its own Grafana image, and three details can need adjustment in PMM: the Uptime panel uses a fixed data source ID, links at the top list PMM dashboards, and rate graphs can look like barcodes. The latter happens because PMM collects external exporters every 10 seconds, while its Metrics data source uses a one second scrape interval. The supplied sed and jq loop patches the data source reference, sets graph intervals to one minute and removes dashboard links from the selected JSON files.
Build on the available metrics
Readyset exposes more than 100 metrics, many of them focused on internal behavior. Metric descriptions are available in Readyset’s metric directory, which is a useful reference when building panels or alerts around a particular workload.
PMM’s direct scrape path keeps setup relatively small, and the dashboards bring cache behavior, query latency and database connectivity into the same monitoring view. The parser workaround and data source naming need attention; after those are handled, teams can track whether Readyset is serving queries from cache and whether the upstream remains reachable.