Monitor the Openflow Connector for MongoDB¶
The connector writes the metrics described on this page to your Openflow event table. A subset of these metrics is also visualized in the Openflow Connectors Dashboard. For generic Openflow telemetry, see Openflow telemetry.
Metrics¶
All metrics include the same resource and connector attributes as application metrics. Collection-level metrics also include collection attributes. Some metrics also include additional attributes.
| Metric | Type | Resolution | Description |
|---|---|---|---|
| db.table.status | Gauge | Collection | Current replication status of the collection. Reported every 60 seconds for every collection in replication. See Replication status values. |
| db.table.status.count | Gauge | Connector | Count of collections in each status. Reported every 60 seconds, as long as any collections are in replication. See Replication status values. |
| db.last.ingestion.time | Gauge | Collection | Time when data was last written to the destination table, in milliseconds since the UNIX epoch. Reported every 60 seconds for up to 3 days after the last write, even when no new data arrives. |
| db.records.ingested | Counter | Collection | Number of records written to Snowflake in each replication phase, indicated by the db.replication.phase attribute. In the SNAPSHOT phase, the value represents the number of records written to the destination table. In the INCREMENTAL phase, the value represents the number of records written to journal tables. Reported every 60 seconds for every collection that received data since the last report. |
| db.commit.to.merge.latency | Gauge | Collection | Highest time, in milliseconds, from when a change was committed in the source database until it was merged into the destination table. Reported every 60 seconds for every collection that received data since the last report. |
| db.commit.to.capture.latency | Gauge | Connector | Highest time, in milliseconds, from when a change was committed in the source database until the connector read it. Reported every 60 seconds while the connector receives data. |
| db.capture.to.journal.latency | Gauge | Connector | Highest time, in milliseconds, from when the connector read a change until it was written to the journal table in Snowflake. Reported every 60 seconds while the connector receives data. |
Collection-level metrics support up to 75,000 collections in a single runtime. Above that limit, metrics might be lost.
Source object attributes¶
Collection-level metrics identify the source collection with the following record attributes:
| Attribute | Description |
|---|---|
| source.schema.name | Name of the source database. |
| source.table.name | Name of the source collection. |
Replication status values¶
The db.table.status metric encodes the replication status of a collection as a number. The mapping is as follows:
| Value | Name | Description |
|---|---|---|
| 0 | - | The collection is no longer replicated, for example because it was removed from replication. Reported once. |
| 1 | NEW | The collection is scheduled for replication, but replication hasn’t started. |
| 2 | SNAPSHOT_REPLICATION | The connector is copying the existing documents of the collection. |
| 3 | INCREMENTAL_REPLICATION | The connector is replicating changes. |
| 4 | FAILED | Replication has permanently stopped for an unknown reason. |
| 4002 | CONTENT_MERGE_FAILED | The connector failed to merge FlowFile content. |
| 4005 | MERGE_QUERY_FAILED | The merge query in Snowflake failed after the maximum number of retries. |
| 4006 | MERGE_QUERY_UNKNOWN_STATUS | The merge query in Snowflake returned an unknown status. |
| 4009 | MISSING_REQUIRED_ATTRIBUTES | A FlowFile is missing required attributes, or has invalid values for them. |
| 4011 | NO_COLUMNS_IN_TABLE | The schema generated for the collection has no columns. |
| 4015 | REMOVED_FROM_REPLICATION | The collection was removed from the source database, no longer matches the collection filter, or is in a permanently failed state. |
| 4016 | SCHEMA_CONVERSION_ERROR | The collection schema couldn’t be converted to the expected format. |
| 4018 | SNOWFLAKE_OBJECT_ALREADY_EXISTS | The Snowflake object already exists and can't be created. |
| 4019 | SNOWFLAKE_OBJECT_OPERATION_FAILED | The connector failed to create, update, or manage a Snowflake object. |
| 4022 | FLOWFILE_READ_ERROR | FlowFile content couldn’t be read or parsed. |
| 4024 | SNOWPIPE2_UPLOAD_FAILED | Snowflake rejected data sent with Snowpipe Streaming because of invalid record content. |
Values of 4001 and higher mean that replication has permanently stopped for the listed reason.
Alerts¶
The following alert templates in the OPENFLOW template group are specific to this connector:
| Template | Description | Settings |
|---|---|---|
| Table replication failure alert | Fires for each collection whose replication failed during the lookback window. Can be configured for the account, a deployment, a runtime, or a connector. |
|
| Openflow data staleness alert | Fires for each of the specified collections when no new data was written to its destination table for longer than the staleness threshold. Can be configured for the account, a deployment, a runtime, or a connector. |
|
For more information and generic Openflow alerts, see Set up alerts for Openflow.
Example queries¶
The following queries assume that Openflow sends telemetry to the default event table,
SNOWFLAKE.TELEMETRY.EVENTS. If you use a different event table, substitute its name.
Find replication failures¶
This query returns the collections whose latest status in the last hour is failed:
Find destination tables without recent data¶
This query returns the collections that had no data written to the destination table in the last hour. A collection without changes in the source database also appears in the results.
Plot replication latency over time¶
This query returns the latency from source commit to destination table for each
collection over the last 24 hours. To
plot it, show the results as a line chart with timestamp on the X-axis and latency_seconds on the Y-axis.
Count records written per replication phase¶
This query returns the number of records written for each collection per hour and replication phase in the last 24 hours: