Monitor the Snowflake Connector for Kafka¶
This topic describes how to monitor the Snowflake Connector for Kafka.
JMX monitoring¶
The connector exposes metrics through Java Management Extensions (JMX) MBeans. JMX is enabled
by default (jmx=true).
To use JMX monitoring, configure your Kafka Connect worker JVM with the following system properties:
You can then use any JMX-compatible monitoring tool (for example, JConsole or Prometheus with a JMX exporter) to view the connector metrics.
MBean domain and naming¶
The connector registers MBeans under the domain snowflake.kafka.connector with the following
ObjectName pattern:
Where <scope> is either task (task-level metrics) or channel (per-partition channel metrics).
Task-level metrics¶
These metrics are scoped to a connector task and provide aggregate visibility into throughput and lifecycle operations.
Metric |
Type |
Description |
|---|---|---|
|
Meter |
Number of records received by the task via |
|
Timer |
Duration of each |
|
Timer |
Duration of pre-commit operations, which include offset verification. |
|
Gauge |
Current number of Kafka partitions assigned to this task. Useful for verifying balanced partition distribution across tasks. |
|
Timer |
Time to open Snowpipe Streaming channels. Elevated values may indicate connection issues. |
|
Counter |
Total number of channels opened by this task. |
|
Counter |
Number of times the connector had to rewind due to downstream backpressure. Sustained non-zero values indicate the connector is producing faster than Snowflake can ingest. |
Channel-level metrics¶
These metrics are scoped to a specific Kafka topic-partition channel and are essential for monitoring ingestion lag and data durability.
Metric |
Type |
Description |
|---|---|---|
|
Gauge |
The most recent offset buffered by the connector. This is the latest record received from Kafka for this partition. |
|
Gauge |
The latest offset confirmed as durably committed in Snowflake. Compare this to
|
|
Gauge |
The latest offset available from the Kafka consumer for this partition. Compare to
|
|
Gauge |
Number of channel recovery events. A high or increasing value indicates instability in the Snowpipe Streaming channel. |
Key metrics for alerting¶
For production deployments, consider alerting on the following:
Ingestion lag:
latest-consumer-offsetminuspersisted-in-snowflake-offset. A growing gap indicates the connector is falling behind.Backpressure:
backpressure-rewind-countincreasing over time.Channel recovery:
channel-recovery-countincreasing, which may indicate connectivity or authentication issues.Put duration:
put-durationmean or p99 exceeding your acceptable threshold.
MDC logging¶
Enable MDC (Mapped Diagnostic Context) logging to prepend connector context to log messages. This is useful when running multiple connector instances and you need to correlate log entries:
Estimating ingestion latency¶
The SnowflakeConnectorPushTime field in RECORD_METADATA records the timestamp when the
connector buffered a record for ingestion. You can use this value to estimate end-to-end
ingestion latency by comparing it against the time the record becomes queryable in Snowflake.
For example:
For more information about monitoring Snowpipe Streaming ingestion, see Snowpipe Streaming key concepts.