Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following metrics would be added at the Task Level:

kafka.connect:type=sink-

...

task-metrics,connector="{connector}",task="{task}"

Attribute nameDescription
  • sink-record-latency-max

...

  • -ms

The maximum latency of a record, measuring by comparing the record timestamp with the system time when it has been received by the Sink task

  • sink-record-latency-avg

...

  • -ms
The average latency of a record, measuring by comparing the record timestamp with the system time when it has been received by the Sink task
  • sink-record-convert-transform-time-max

...

  • -ms
The maximum time taken by this task to convert and transform a record.
  • sink-record-convert-transform-time-avg

...

  • -ms
The average time taken by this task to convert and transform a record.


kafka.connect:type=source-task-metrics,connector="{connector}",task="{task}"

Attribute nameDescription
  • source-record-transform-convert-time-max

...

  • -ms

The maximum time in milliseconds taken by this task to transform and convert for a record.

  • source-record-transform-convert-time-avg

...

  • -ms
The average time in milliseconds taken by this task to transform and convert for a record.


Proposed Changes

Sink Connectors have 3 stages:

  • polling: gather batch of consumer records

  • convert/transform: convert records individually to generic SinkRecord  and , apply transformers, and prepare batches

  • process: put record batches into a external system.

Process stage already has a latency metric: put-batch-time 

To measure record latency sink-record-latency , it's proposed to measure the different between record timestamp and current system time (wall-clock) at the beginning of the convert stage as it is when records are iterated already.

Convert latency sink-record-convert-transform-time  measures the convert and transformation per-record.

Polling can be monitored with Consumer fetch metrics, e.g. fetch-latency-avg/max 

...

On the other hand, in the Source Connector has:

  • polling: gather batch of records from external system

  • transform/convert: apply transformations and convert records to ProducerRecord  individually
  • send records: send records to Kafka topics individually

Polling records stage already has a latency metric: poll-batch-time .

source-record-transform-convert-time metric will measure the transformations applied and conversion from SourceRecord  into ProducerRecord .

...