Versions Compared

Key

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

...

There are several things that are out of scope for this proposal, though they may be addressed in future KIPs. First, this proposal expressly avoids changes to the Connect API, and therefore does not address how connector implementations can define their own connector-specific metrics. Second, Kafka Connect does not have any existing mechanism to aggregate the metrics reported by each workeracross multiple workers.

Public Interfaces

All of the following will be added via Kafka's metrics library like most of the metrics in the Kafka brokers and other components. The context of all metrics are limited to the worker where the metrics are being reported, and all metrics include the worker ID in the MBean attribute (similarly to how Kafka producer and consumer metrics include the client ID)are defined as attributes on the specified MBean attribute and are measured within the context of a single worker.

 


Connector Metrics

...

MBean namekafka.connect:type=connector-metrics

...

,connector=([-.\w]+)


Metric NameDescription
connector-classtypeThe name type of the connector class, one of: source, sink
connector-classThe name of the connector classkafka.connect:type=connector-metrics,name=connector-class,connector=([-.\w]+)
connector-versionThe version of the connector class, as reported by the connector in this workerkafka.connect:type=connector-metrics,name=connector-version,connector=([-.\w]+)
statusThe current status of the connector in this worker, one of: running, paused, stopped  kafka

Common Task Metrics

MBean namekafka.connect:type=

...

task-metrics

...

,connector=([-.\w]+)

...


Metric NameDescriptionMBean attribute
statusThe current status of this task, one of: unassigned, running, paused, failed, destroyedkafka.connect:type=task-metrics,name=status,connector=([-.\w]+),task=([\d]+)
pause-ratioThe fraction of time this task has spent in the paused state.kafka.connect:type=task-metrics,name=pause-ratio  ,connector=([-.\w]+),task=([\d]+)
offset-commit-success-percentageThe average percentage of this task's offset commit attempts that succeededkafka.connect:type=task-metrics,name=offset-commit-success-percentage,connector=([-.\w]+),task=([\d]+)
offset-commit-failure-percentageThe average percentage of this task's offset commit attempts that failed or had an errorkafka.connect:type=task-metrics,name=offset-commit-failure-percentage,connector=([-.\w]+),task=([\d]+)
offset-commit-max-timeThe maximum time taken by this task to commit offsets
kafka.connect:type=task-metrics,name=offset-commit-max-time,connector=([-.\w]+),task=([\d]+)offset-commit-99p-timeThe 99th percentile time spent by this task to commit offsets
kafka.connect:type=task-metrics,name=offset-commit-99p-time,connector=([-.\w]+),task=([\d]+)offset-commit-95p-timeThe 95th percentile time spent by this task to commit offsetskafka.connect:type=task-metrics,name=offset-commit-95p-time,connector=([-.\w]+),task=([\d]+)
offset-commit-90p-timeThe 90th percentile time spent by this task to commit offsets
kafka.connect:type=task-metrics,name=offset-commit-90p-time,connector=([-.\w]+),task=([\d]+)offset-commit-75p-timeThe 75th percentile time spent by this task to commit offsets
kafka.connect:type=task-metrics,name=offset-commit-75p-time,connector=([-.\w]+),task=([\d]+)offset-commit-50p-timeThe 50th percentile (average) time spent by this task to commit offsetskafka.connect:type=task-metrics,name=offset-commit-50p-time,connector=([-.\w]+),task=([\d]+)
batch-size-maxThe maximum size of the batches processed by the connectorkafka.connect:type=task-metrics,name=batch-size-max, connector=([-.\w]+),task=([\d]+)
batch-size-avgThe average size of the batches processed by the connector

Source Task Metrics

MBean namekafka.connect:type=source-task-metrics

...

,connector=([-.\w]+),task=([\d]+)

...

Source Task Metrics

 


Metric NameDescriptionMBean attribute
source-record-poll-rateThe average per-second number of records produced/polled (before transformation) by this task belonging to the named source connector in this worker. This is before transformations are applied.kafka.connect:type=source-task-metrics,name=source-record-produce-rate,connector=([-.\w]+),task=([\d]+)
source-record-write-rateThe average per-second number of records per second output from the transformations and written to Kafka for this task belonging to the named source connector in this worker. This is after transformations are applied.

 

Sink Task Metrics

MBean namekafka.connect:type=

...

sink-task-metrics

...

,connector=([-.\w]+),task=([\d]+)

...

 

...


-read-rate,connector=([.\w]+),task=([\d]+) window
Metric NameDescriptionMBean attribute
sink-record-read-rateThe average per-second number of records read from Kafka for this task belonging to the named sink connector in this worker. This is before transformations are applied.kafka.connect:type=sink-task-metrics,name=
sink-record-sink-record-send-rateThe average per-second numbrer of records output from the transformations and sent to this task belonging to the named sink connector in this worker. This is after transformations are applied and excludes any records filtered out by the transformations.kafka.connect:type=sink-task-metrics,name=sink-record-process-rate  ,connector=([-.\w]+),task=([\d]+)
sink-record-lag-maxThe maximum lag in terms of number of records behind the consumer the offset commits are for any topic partitions.
partition-countThe number of topic partitions assigned to this task belonging to the named sink connector in this worker.


MBean namekafka.connect:type=sink-task-metrics

...

,connector=([-.\w]+),task=([\d]+)

...

,

...

topic

...

=([-.\w]+),

...

partition=([\d]+)


Metric NameDescription
sink-record-{topic}-{partition}.records-lag-avgThe average latest lag in terms of number of records behind the consumer the offset commits are for the topic partition.
kafka.connect:type=sink-task-metrics,name=sink-record-{topic}-{partition}-lag-avg,connector=([-.\w]+),task=([\d]+)sink-record-{topic}-{partition}.records-lag-maxThe average The maximum lag in terms of number of records behind the consumer the offset commits are for the topic partition.
kafka.connect:type=sink-task-metrics,name=sink-record-{topic}-{partition}-lag-max,connector=([-.\w]+),task=([\d]+)partition-countThe number of topic partitions assigned to this task belonging to the named sink connector in this worker.The maximum lag in terms of number of records behind the consumer the offset commits are for the topic partition.

Worker Metrics

MBean namekafka.connect:type=

...

connect-

...

worker-metrics,

...

connector=([-.\w

...

]+)

...

Worker Metrics

 


Metric NameDescriptionMBean attribute

assigned-tasks

The number of tasks run in this worker (mirrors existing metric)
kafka.connect:type=connect-coordinator-metrics,name=assigned-tasksassigned-connectorsThe number of connectors run in this worker (mirrors existing metric)kafka.connect:type=connect-coordinator-metrics,name=assigned-connectors

task-count

The number of tasks run in this workerkafka.connect:type=connect- worker-metrics,name=task-count
connector-countThe number of connectors run in this workerkafka.connect:type=connect- worker-metrics,name=connector-count
leader-nameThe name of the group leaderkafka.connect:type=connect-worker-metrics,name= leader-name 
stateThe state of this worker, one of: rebalancing, runningkafka.connect:type=connect-worker-metrics,name=state 
rest-request-rateThe average per second number of requests handled by the REST endpoints in this worker


Worker Rebalance Metrics

MBean namekafka.connect:type=connect-worker-rebalance-metrics,

...

connector=

...

([-.\w]+)


95p-time
Metric NameDescriptionMBean attribute
rebalance-success-totalThe total number of this worker's successful rebalanceskafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-success-total
rebalance-success-percentageThe average percentage of this worker's rebalances that succeededkafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-success-percentage 
rebalance-failure-totalThe total number of this worker's failed rebalances
kafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-failure-totalrebalance-failure-percentageThe average percentage of this worker's rebalances that failed
kafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-failure-percentagerebalance-max-timeThe maximum time spent by this worker to rebalancekafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-max-time
rebalance-99p-timeThe 99th percentile time spent by this worker to rebalance during the last window (defaults to an hour)
kafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-99p-timerebalance-95p-timeThe 95th percentile time spent by this worker to rebalance during the last window (defaults to an hour)kafka.connect:type=connect-worker-rebalance-metrics,name=
rebalance-rebalance-90p-timeThe 90th percentile time spent by this worker to rebalance during the last window (defaults to an hour)kafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-90p-time
rebalance-75p-timeThe 75th percentile time spent by this worker to rebalance during the last window (defaults to an hour)kafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-75p-time
rebalance-50p-timeThe 50th percentile (average) time spent by this worker to rebalance during the last window (defaults to an hour)kafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-50p-
timetime-since-last-rebalanceThe time since the most recent rebalance in this workerkafka.connect:type=connect-worker-rebalance-metrics,name=time-since-last-rebalance
task-failure-rateThe number of tasks that failed in this workerkafka.connect:type=connect- worker-rebalance-metrics,name=task-failure-rate

Proposed Changes

We will add the relevant metrics as specified in the Public Interfaces section, except for the two existing metrics that will be left unmodified.

...