Monitor the Openflow Connector for Kafka¶
The connector writes the metrics described on this page to your Openflow event table. For generic Openflow telemetry, see Openflow telemetry.
Metrics for consuming data from Kafka¶
All metrics include the same resource and connector attributes as application metrics. Additionally, they include Kafka-specific metric attributes.
| Metric | Type | Resolution | Description |
|---|---|---|---|
| kafka.records.consumer.lag | Gauge | Topic and partition | Highest number of records this consumer was behind during the reporting interval. Reported every 60 seconds for partitions that returned records since the last report. |
| kafka.records.consumed | Counter | Topic and partition | Number of Kafka messages consumed during the reporting interval. Reported every 60 seconds for every topic and partition that consumed messages since the last report. |
| kafka.bytes.consumed | Counter | Topic and partition | Number of bytes consumed during the reporting interval. The value is the length of the message key plus the length of the message value, after the Kafka client decompresses the batch. Message headers aren’t included. Reported every 60 seconds for every topic and partition that consumed messages since the last report. |
| kafka.records.parsed.errors | Counter | Topic and partition | Number of records that failed to parse during the reporting interval. Reported every 60 seconds for every topic and partition with a parse error since the last report. |
These metrics support up to 10,000 topic and partition combinations in a single runtime. Above that limit, further combinations are reported together.
The connector reports these metrics when it reads the data, before the batch is committed. A batch that is read again is counted again.
Kafka-specific metric attributes¶
Kafka metrics include the following metric attributes:
| Attribute | Description |
|---|---|
| kafka.topic | Name of the Kafka topic. |
| kafka.partition | Partition of the topic. |
Metrics for pushing data to Snowpipe Streaming¶
All metrics include the same resource and connector attributes as application metrics. Additionally, they can also include source and destination metric attributes.
These metrics are reported when the Metric Resolution property is Destination or Source and Destination. This property can be set on the PublishSnowpipeStreaming processor inside your connector or custom flow.
| Metric | Type | Resolution | Description |
|---|---|---|---|
| snowpipe.streaming.rows.sent | Counter | Destination | Number of rows sent to Snowpipe Streaming after a successful insert. Reported every 60 seconds for every destination that received data since the last report. |
| snowpipe.streaming.bytes.sent | Counter | Destination | Number of uncompressed bytes sent to Snowpipe Streaming, measured before compression. Reported every 60 seconds for every destination that received data since the last report. |
| snowpipe.streaming.last.push.time | Gauge | Destination | Time when rows were last pushed to Snowpipe Streaming, in milliseconds since the UNIX epoch. Reported every 60 seconds for up to 3 days after the last push, even when no new rows are pushed. |
| snowpipe.streaming.consume.to.push.latency | Gauge | Destination | Highest time, in milliseconds, from when the connector read the data until the rows were pushed to Snowpipe Streaming. Reported every 60 seconds for every destination that received data since the last report. |
These metrics support up to 10,000 destinations in a single runtime. Above that limit, metrics might be lost.
The connector reports these metrics after a successful insert using Snowpipe Streaming.
How the lag and latency metrics relate¶
A record passes through consecutive stages: it waits in the source until the connector reads it, the connector processes it and pushes it to Snowpipe Streaming, and then Snowpipe Streaming makes the rows queryable. The metrics cover these stages as follows:
- Consumer lag (
kafka.records.consumer.lag) covers how far the connector is behind the latest record in the partition. It’s measured in records, not time, so you can’t add it to the push latency.
- Push latency (
snowpipe.streaming.consume.to.push.latency) covers the time from when the connector reads the data until the rows are pushed to Snowpipe Streaming.
The time until pushed rows become queryable doesn’t have its own metric, and there’s no end-to-end latency metric. A reported push doesn’t mean that the rows are queryable yet.
Each metric reports the highest value in each 1-minute reporting interval. Because these are maximums, and the consumer lag is reported per topic and partition while the push latency is reported per destination, the values don’t add up exactly.
Source and destination metric attributes¶
These metrics can include the following metric attributes:
| Attribute | Description |
|---|---|
| destination.database.name | Name of the destination database. |
| destination.schema.name | Name of the destination schema. |
| destination.pipe.name | Name of the pipe. When the destination is a table, this is the default pipe in the form of {table}-STREAMING. |
| source.name | Value of the Source Name property. |
The destination.* attributes are included when Metric Resolution on
PublishSnowpipeStreaming processor is Destination or Source and Destination.
source.name is included only when Metric Resolution is Source and Destination.
In this connector, set the Source Name property to ${kafka.topic}. A merge keeps Source Name when every merged FlowFile has the same value. A merge of different sources can drop Source Name. If Source Name is blank or missing, including when a merge drops it, the rows are still counted and the source.name attribute is omitted.
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.
Count messages consumed¶
This query returns the number of messages consumed for each topic and partition per hour in the last 24 hours. Each value covers one 60-second interval, so the query sums the values:
Plot consumer lag over time¶
This query returns how many records this consumer was behind for each topic and partition over the
last 24 hours. To plot it, show the results as a line chart with timestamp on the X-axis and
records_behind on the Y-axis.
Count rows sent to each destination¶
This query returns the number of rows sent for each destination per hour in the last 24 hours. Each value covers one 60-second interval, so the query sums the values:
Plot push latency over time¶
This query returns the highest time from when the connector read the data until it was pushed to
Snowpipe Streaming, for each destination 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.