Blip Docs
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

repl.lag

The repl.lag domain includes metrics from multiple sources related to replication lag and event processing.

This domain does not collect Seconds_Behind_Source (fka Seconds_Behind_Master) because this historical metric is not an industry best practice. Instead, use Blip heartbeats or Performance Schema.

Usage

There are two replication lag writers:

 Blip HeartbeatMySQL 8.x Performance Schema
PreferredNoYes, writer = auto
External SetupYesNo
Extra User PrivsYesNo
MSR and MTRNoYes
MySQL VersionAny8.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.

Derived Metrics

backlog

Metric Typegauge
Value Unitsevents [0, inf.)
Writerpfs

Number of events not applied.

Only available with MySQL 8.x Performance Schema.

current

Metric Typegauge
Value Unitsmilliseconds
WriterAny

The current replication lag in milliseconds.

worker_usage

Metric Typegauge
Value Unitspercentage [0, 1.0]
Writerpfs

Percentage (0.0-1.0) of applier threads (worker) seen applying during collection.

Only available with MySQL 8.x Performance Schema.

Options

Common

repl-check

ValueMySQL 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.

writer

ValueDefaultDescription
autoUse pfs if available, else use blip
blipUse Blip heartbeat
pfsUse MySQL 8.x Performance Schemna tables

What is writing replication heartbeats or events.

MySQL 8.x Performance Schmea

default-channel-name

Value Typestring
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.

Blip Heartbaet

network-latency

Value TypeDuration string
Default50ms

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.

report-no-heartbeat

ValueDefaultDescription
yesReport current = -1 if no heartbeat
noDrop current metric if no heartbeat

report-not-a-replica

ValueDefaultDescription
yesReport current = -1 if not a replica
noDrop current metric if not a replica

source-id

Valuestring
Default

See Config / Heartbeat for details.

source-role

Valuestring
Default

See Config / Heartbeat for details.

table

Valuestring
Defaultblip.heartbeat

See Config / Heartbeat – Table for details.

Group Keys

Only when using MySQL 8.x Performance Schema:

KeyValue
channel_nameCHANNEL_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.

Meta

None.

Error Policies

None.

MySQL Config

MySQL must be configured as a replica, and the Performance Schema must be enabled.

Changelog

Blip VersionChange
v1.1.0• Added support for MySQL 8.x Performance Schema
• Default writer changed from “blip” to “auto”, preferring Performance Schema (“pfs”)
v1.0.0Domain added