Bug #106088 Please add counters for trx and bytes written to the binlogs.
Submitted: 6 Jan 2022 19:02 Modified: 7 Jan 2022 5:50
Reporter: Jean-François Gagné Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S4 (Feature request)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[6 Jan 2022 19:02] Jean-François Gagné
Description:
Hi,

knowing how many transactions and bytes are written to the binary logs is an important part of monitoring MySQL.  However, there are no direct ways to check this.

LeFred wrote a blog post about an indirect way of counting transactions written to the binlogs by counting GTIDs [1], but even if this is a nice hack, a more straightforward way of doing this should be available in MySQL.  Moreover, this does not work with GTID disabled.

[1]: https://lefred.be/content/mysql-how-many-transactions-where-committed-during-an-interval-o...

Many thanks for looking into this,

Jean-François Gagné

How to repeat:
N/A because not a bug, but a feature request.

Suggested fix:
A counter like Handler_commit (suggested name Binlog_trx) would solve the problem for counting trx written to the binlogs.  Note that DDL should also increment Binlog_trx.

A counter like Bytes_sent (suggested name Binlog_bytes_written) would solve the problem for counting bytes written to the binlogs.
[7 Jan 2022 5:50] MySQL Verification Team
Hello Jean-François,

Thank you for the feature request!

regards,
Umesh