Conversation
…anels The bundled mysqld_exporter already ships a perf_schema.memory_events collector over performance_schema.memory_summary_global_by_event_name, exposing mysql_perf_schema_memory_events_used_bytes / _alloc_bytes_total / _free_bytes_total per event_name. PMM never enabled it and no dashboard rendered it. - Enable the collector in both synced generators: the mysqld_exporter flag list (mysql.go, LR group) and the VM scrape-config generator (scrape_configs.go, LR options), keeping the two in sync. - Update the golden tests (mysql_test.go, scrape_configs_test.go, victoriametrics_test.go) for the added collector. - Add a "Performance Schema Memory" section to the MySQL Performance Schema Details dashboard: current bytes used (topk by event), allocation rate and free rate, plus a "Memory Event" filter variable. Panels degrade to no-data when memory instruments are not enabled server-side. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TNZLMVAW9gHXcccq8uYBip
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5649 +/- ##
==========================================
- Coverage 43.59% 42.41% -1.18%
==========================================
Files 415 431 +16
Lines 43134 34821 -8313
Branches 0 585 +585
==========================================
- Hits 18804 14770 -4034
+ Misses 22454 18568 -3886
+ Partials 1876 1483 -393
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| "--collect.info_schema.clientstats", | ||
| "--collect.info_schema.userstats", | ||
| "--collect.perf_schema.eventsstatements", | ||
| "--collect.perf_schema.memory_events", |
There was a problem hiding this comment.
Since collector is enabled globally, I think this collector fails on MariaDB versions before 10.5.2 because the required table does not exist. If so could we add message and include it in tests?
I just added message about compatibility on different MySQL dashboard and it looks like this:

Because it is hard to tell if "NO DATA" are because of error or I am using unsupported version.
EDIT: My mistake, apparently we no longer officially support MariaDB.
| "steppedLine": false, | ||
| "targets": [ | ||
| { | ||
| "expr": "topk(10, rate(mysql_perf_schema_memory_events_free_bytes_total{service_name=~\"$service_name\", event_name=~\"$mem_event_name\"}[$interval]))", |
There was a problem hiding this comment.
What if interval is set to 30s? This collector runs at low resolution, but the queries use rate(...[$interval]). When $interval is shorter than the scrape interval, rate() does not have enough samples and could returns no data.
| "steppedLine": false, | ||
| "targets": [ | ||
| { | ||
| "expr": "topk(10, rate(mysql_perf_schema_memory_events_alloc_bytes_total{service_name=~\"$service_name\", event_name=~\"$mem_event_name\"}[$interval]))", |
There was a problem hiding this comment.
I think it could be same case as #5649 (comment)
Ticket number: PMM-12279
Feature build: SUBMODULES-0
What / why
PMM's bundled
mysqld_exporteralready ships aperf_schema.memory_eventscollector overperformance_schema.memory_summary_global_by_event_name, exposing memory usage perevent_name:mysql_perf_schema_memory_events_used_bytes(=CURRENT_NUMBER_OF_BYTES_USED)mysql_perf_schema_memory_events_alloc_bytes_totalmysql_perf_schema_memory_events_free_bytes_totalThe collector was never enabled by PMM and nothing rendered it. This PR turns it on and graphs it, giving memory observability for PS/PXC (especially relevant in k8s).
Changes
managed/services/agents/mysql.go— add--collect.perf_schema.memory_eventsto the LR args.managed/services/victoriametrics/scrape_configs.go— addperf_schema.memory_eventsto the LR scrape options, keeping the two lists in sync.mysql_test.go,scrape_configs_test.go,victoriametrics_test.go.performance-schema-instrument='memory/%=ON').Testing
Validated end-to-end against two monitored instances, Percona Server 8.0.46 and MySQL 9.1.0:
mysqld_exporterprocesses carry--collect.perf_schema.memory_events.innodb/buf_buf_pool= 130.9 MB on both).up=1on all scrape jobs; no scrape errors and no parse/"unsupported" warnings on MySQL 9.1.TestMySQLdExporterConfig*andTestScrapeConfigpass; both packages build.No regression on 8.0; works on the newer 9.x series.
If this PR adds, removes or alters one or more API endpoints, please review and update the relevant API documentation as well:
If this PR is related to other PRs, contributions, or ongoing work in this or other repositories, please reference them here:
🤖 Generated with Claude Code
https://claude.ai/code/session_01TNZLMVAW9gHXcccq8uYBip
Generated by Claude Code