PMM2 client not exporting mysql_heartbeat_timediff_sec

Hi,

I’m monitoring two MySQL slaves A and B whose masters both run the pt-heartbeat daemon.
For slave A I see the value of mysql_heartbeat_timediff_sec in PMM, for B I don’t.

What I’ve checked so far:

  • According to VMUI only the A pmm exporter is exporting a mysql_heartbeat_timediff_sec value. Other mysql_ metrics are exported by both servers.
  • Both slaves show “mysqld_exporter … --collect.heartbeat” in the process list.
  • The updates from the master to the percona.heartbeat tables are being replicated to both slaves.
  • MySQL versions are 5.7.40 (A) and 5.7.41 (B). Both slaves have PMM in version 2.34.0, PMM Server is version 2.34.0 too.

The only difference I see in the configurations (aside from the slightly different MySQL versions) is that B is running mysqld_exporter with “–disable-tablestats” (which can’t be omitted because of a very high number of tables).

Would “–disable-tablestats” also disable the collector for heartbeat? Any suggestions what I could try for server B to make it export mysql_heartbeat_timediff_sec?

1 Like

Hello @steffen,
The --collect.heartbeat collector looks for heartbeat inside heartbeat.heartbeat, not percona.heartbeat. You need to relaunch pt-heartbeat with this change to the database. I completely understand your frustration on this as I experienced the same issue. I had to dig through the code to find out what wasn’t working. I’ve opened a bug on this: [PMM-11520] PMM looks for pt-heartbeat in a non-standard location - Percona JIRA

1 Like

Hi Matthew,
thanks, that was the reason. It’s unfortunate that the pmm-agent doesn’t log any error message about not finding “heartbeat.heartbeat”.

Instead of reconfiguring the pt-heartbeat daemon one can also use this view as workaround:

CREATE DATABASE heartbeat DEFAULT CHARACTER SET utf8;
CREATE VIEW heartbeat.heartbeat AS SELECT * FROM percona.heartbeat;
1 Like

Oh, very nice workaround with the VIEW!

1 Like