// Metadata created by nebel
//

[id="mysql-connector-monitoring-metrics_{context}"]
= MySQL connector monitoring metrics

The {prodname} MySQL connector has three metric types in addition to the built-in support for JMX metrics that Zookeeper, Kafka, and Kafka Connect have.

* <<mysql-connector-snapshot-metrics, snapshot metrics>>; for monitoring the connector when performing snapshots
* <<mysql-connector-binlog-metrics, binlog metrics>>; for monitoring the connector when reading CDC table data
* <<mysql-connector-schema-history-metrics, schema history metrics>>; for monitoring the status of the connector's schema history

Refer to the {link-prefix}:{link-debezium-monitoring}#monitoring-debezium[monitoring documentation] for details of how to expose these metrics via JMX.

== Snapshot metrics
[[mysql-connector-snapshot-metrics]]

The *MBean* is `debezium.mysql:type=connector-metrics,context=snapshot,server=<database.server.name>`.

include::{partialsdir}/modules/all-connectors/ref-connector-monitoring-snapshot-metrics.adoc[leveloffset=+1]

The {prodname} MySQL connector also provides the following custom snapshot metrics:

[cols="3,2,5"]
|===
|Attribute |Type |Description

|`HoldingGlobalLock`
|`boolean`
|Whether the connector currently holds a global or table write lock.

|===


== Binlog metrics
[[mysql-connector-binlog-metrics]]

The *MBean* is `debezium.mysql:type=connector-metrics,context=binlog,server=<database.server.name>`.

NOTE: The transaction-related attributes are only available if binlog event buffering is enabled. See {link-prefix}:{link-mysql-connector}#mysql-connector-configuration-properties_{context}[binlog.buffer.size] in the advanced connector configuration properties for more details.

include::{partialsdir}/modules/all-connectors/ref-connector-monitoring-streaming-metrics.adoc[leveloffset=+1]

The {prodname} MySQL connector also provides the following custom binlog metrics:

[cols="3,2,5"]
|===
|Attribute |Type |Description

|`BinlogFilename`
|`string`
|The name of the binlog filename that the connector has most recently read.

|`BinlogPosition`
|`long`
|The most recent position (in bytes) within the binlog that the connector has read.

|`IsGtidModeEnabled`
|`boolean`
|Flag that denotes whether the connector is currently tracking GTIDs from MySQL server.

|`GtidSet`
|`string`
|The string representation of the most recent GTID set seen by the connector when reading the binlog.

|`NumberOfSkippedEvents`
|`long`
|The number of events that have been skipped by the MySQL connector.  Typically events are skipped due to a malformed or unparseable event from MySQL's binlog.

|`NumberOfDisconnects`
|`long`
|The number of disconnects by the MySQL connector.

|`NumberOfRolledBackTransactions`
|`long`
|The number of processed transactions that were rolled back and not streamed.

|`NumberOfNotWellFormedTransactions`
|`long`
|The number of transactions that have not conformed to expected protocol `BEGIN` + `COMMIT`/`ROLLBACK`. Should be `0` under normal conditions.

|`NumberOfLargeTransactions`
|`long`
|The number of transactions that have not fitted into the look-ahead buffer. Should be significantly smaller than `NumberOfCommittedTransactions` and `NumberOfRolledBackTransactions` for optimal performance.

|===

== Schema history metrics
[[mysql-connector-schema-history-metrics]]

The *MBean* is `debezium.mysql:type=connector-metrics,context=schema-history,server=<database.server.name>`.

include::{partialsdir}/modules/all-connectors/ref-connector-monitoring-schema-history-metrics.adoc[leveloffset=+1]
