repl.lag
The repl.lag
domain includes metrics from multiple sources related to replication lag and event processing.
This domain does not collectSeconds_Behind_Source
(fkaSeconds_Behind_Master
) because this historical metric is not an industry best practice. Instead, use Blip heartbeats or Performance Schema.
There are two replication lag writers:
Blip Heartbeat | MySQL 8.x Performance Schema | |
---|---|---|
Preferred | No | Yes, writer = auto |
External Setup | Yes | No |
Extra User Privs | Yes | No |
MSR and MTR | No | Yes |
MySQL Version | Any | 8.x |
If running MySQL 8.x, use the Performance Schema.
The Blip heartbeat is the legacy writer and should be used only when needed.
The main derived metric is current
that reports current replication lag in milliseconds.
On MySQL 8.x, Performance Schema is used to report other derived metrics.
When using MySQL 8.x Performance Schema, metrics are grouped by channel name.
Metric Type | gauge |
Value Units | events [0, inf.) |
Writer | pfs |
Number of events not applied.
Only available with MySQL 8.x Performance Schema.
Metric Type | gauge |
Value Units | milliseconds |
Writer | Any |
The current replication lag in milliseconds.
Metric Type | gauge |
Value Units | percentage [0, 1.0] |
Writer | pfs |
Percentage (0.0-1.0) of applier threads (worker) seen applying during collection.
Only available with MySQL 8.x Performance Schema.
Value | MySQL global variable (without @@) |
Default |
If the given MySQL global variable equal zero, the instance is not a replica. Any other value and the instance is considered a replica.
Value | Default | Description |
---|---|---|
auto | ✓ | Use pfs if available, else use blip |
blip | Use Blip heartbeat | |
pfs | Use MySQL 8.x Performance Schemna tables |
What is writing replication heartbeats or events.
Value Type | string |
Default |
Set to rename default channel name from an empty string (the MySQL default) to a non-empty string. Metrics are grouped by channel name.
Value Type | Duration string |
Default | 50ms |
How long to wait for the next Blip heartbeat in addition to its planned arrival time.
This amount is also subtracted from the current
value.
For example, if the next heartbeat is scheduled to arrive at 12:00:00.000 and network latency is 50ms, Blip waits until 12:00:00.050 to read the heartbeat.
Value | Default | Description |
---|---|---|
yes | Report current = -1 if no heartbeat | |
no | ✓ | Drop current metric if no heartbeat |
Value | Default | Description |
---|---|---|
yes | Report current = -1 if not a replica | |
no | ✓ | Drop current metric if not a replica |
Value | string |
Default |
See Config / Heartbeat for details.
Value | string |
Default |
See Config / Heartbeat for details.
Value | string |
Default | blip.heartbeat |
See Config / Heartbeat – Table for details.
Only when using MySQL 8.x Performance Schema:
Key | Value |
---|---|
channel_name | CHANNEL_NAME column value |
Like MySQL, the default channel name is an empty string.
For Blip reporting, this can be changed with option default-channel-name
.
None.
None.
MySQL must be configured as a replica, and the Performance Schema must be enabled.
Blip Version | Change |
---|---|
v1.1.0 | • Added support for MySQL 8.x Performance Schema • Default writer changed from “blip” to “auto”, preferring Performance Schema (“pfs”) |
v1.0.0 | Domain added |