<a id="cc-mongodb-cdc-source-monitoring"></a>

# Monitoring MongoDB CDC Source Connector for Confluent Cloud

The MongoDB CDC Source connector exposes metrics through
the [Confluent Cloud Metrics API](https://docs.confluent.io/cloud/current/monitoring/metrics-api.html#ccloud-metrics)
to assist with connector monitoring and troubleshooting.

## Connector metrics

The MongoDB CDC Source connector provides two metric types:

* [Snapshot metrics](#cc-mongodb-cdc-snapshot-metrics)
* [Streaming metrics](#cc-mongodb-cdc-streaming-metrics)

All metrics share the prefix
`io.confluent.kafka.connect/mongodb_cdc_source_connector_`.
The tables below list only the metric suffix.

<a id="cc-mongodb-cdc-snapshot-metrics"></a>

### Snapshot metrics

Snapshot metrics help you monitor the connector during snapshot
operations. These metrics are only available if a snapshot is currently
active or if the connector has performed a snapshot since its last
start.

| Metric                                   | Type   | Description                                                                               |
|------------------------------------------|--------|-------------------------------------------------------------------------------------------|
| `snapshot_running`                       | int    | Whether the snapshot is running. Values: `0` = false, `1` = true.                         |
| `snapshot_completed`                     | int    | Whether the snapshot is complete. Values: `0` = false, `1` = true.                        |
| `snapshot_aborted`                       | int    | Whether the snapshot was aborted. Values: `0` = false, `1` = true.                        |
| `snapshot_milliseconds_since_last_event` | long   | The number of milliseconds since the last snapshot event was<br/>recorded.                |
| `snapshot_total_number_of_events_seen`   | long   | The total number of events the connector has processed since its last<br/>start or reset. |
| `snapshot_duration_in_seconds`           | long   | The total number of seconds that the snapshot has taken so far,<br/>even if not complete. |
| `snapshot_paused_duration_in_seconds`    | long   | The total paused duration of the snapshot, in seconds.                                    |
| `snapshot_number_of_disconnects`         | long   | The number of disconnects by the connector during the snapshot.                           |

<a id="cc-mongodb-cdc-streaming-metrics"></a>

### Streaming metrics

Streaming metrics help you monitor the connector when streaming changes
from the database.

| Metric                                       | Type   | Description                                                                                                                                                                                                                                               |
|----------------------------------------------|--------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `streaming_is_connected`                     | int    | Whether the connector is connected to the database<br/>server. Values: `0` = false, `1` = true.                                                                                                                                                           |
| `streaming_milliseconds_since_last_event`    | long   | The number of milliseconds since the last streaming event was<br/>recorded.                                                                                                                                                                               |
| `streaming_total_number_of_events_seen`      | long   | The total number of data change events reported by the source<br/>database since the connector was last started or since a metrics<br/>reset.                                                                                                             |
| `streaming_number_of_events_filtered`        | long   | The number of events filtered out based on the include or exclude<br/>list rules configured in the connector.                                                                                                                                             |
| `streaming_number_of_committed_transactions` | long   | The number of processed transactions that were committed.                                                                                                                                                                                                 |
| `streaming_number_of_disconnects`            | long   | The number of times the connector disconnected.                                                                                                                                                                                                           |
| `streaming_number_of_primary_elections`      | long   | The number of primary elections observed by the connector.                                                                                                                                                                                                |
| `lag_milliseconds`                           | long   | The number of milliseconds between the timestamp of the last<br/>change event and the time the connector processed it. The value<br/>incorporates any clock differences between the machines where the<br/>database server and the connector are running. |
