Monitor the Openflow Connector for Amazon Kinesis Data Streams¶
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 Kinesis¶
All metrics include the same resource and connector attributes as application metrics. Additionally, they include Kinesis-specific metric attributes.
| Metric | Type | Resolution | Description |
|---|---|---|---|
| kinesis.consumer.milliseconds.behind | Gauge | Stream and shard | Highest age, in milliseconds, of the records the consumer is reading. Reported every 60 seconds for shards the connector owns, including when a read returns no new records. |
| kinesis.records.consumed | Counter | Stream and shard | Number of Kinesis records consumed during the reporting interval. Reported every 60 seconds for every stream and shard that consumed records since the last report. |
| kinesis.bytes.consumed | Counter | Stream and shard | Number of bytes consumed during the reporting interval. The partition key isn’t included. Reported every 60 seconds for every stream and shard that consumed records since the last report. |
| kinesis.records.parsed.errors | Counter | Stream and shard | Number of records that failed to parse during the reporting interval. Reported every 60 seconds for every stream and shard with a parse error since the last report. |
These metrics support up to 10,000 stream and shard 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.
Kinesis-specific metric attributes¶
Kinesis metrics include the following metric attributes:
| Attribute | Description |
|---|---|
| aws.kinesis.stream.name | Name of the Kinesis stream. |
| aws.kinesis.shard.id | Identifier of the shard. |
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 (
kinesis.consumer.milliseconds.behind) covers how far the connector is behind the latest record in the shard.
- 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 stream and shard 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 ${aws.kinesis.stream.name}. 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 records consumed¶
This query returns the number of records consumed for each stream and shard 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 the highest age of the records read for each stream and shard over the last
24 hours. To plot it, show the results as a line chart with timestamp on the X-axis and
age_seconds 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.