You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

Status

Current stateUnder Discussion

Discussion thread: here

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

An important part of deploying Kafka Connect is monitoring the health of the workers in a cluster and the connectors and tasks that have been deployed to the cluster. The Kafka Connect framework only has a few metrics capturing the number of connectors and tasks for each worker, so we propose to add metrics to monitor more information about the connectors, tasks, and workers. This proposal expressly avoids changes to the Connect API, and therefore does not address how connector implementations can define their own connector-specific metrics.

All metrics reported by each worker are scoped by the activities within that worker. Kafka Connect does not have any existing mechanism to aggregate the metrics reported by each worker, and therefore any such aggregation is out of scope for this KIP.

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 scope of all metrics are limited to the worker where the metrics are being reported, and all metric names include the name of the worker in the MBean attribute.

Source Task Metrics

Metric NameDescriptionMBean attribute
source record produce rateThe number of records per second produced (before transformation) by this task belonging to the named source connector in this workerkafka.connect:type=source-task-metrics,name=source-record-produce-rate,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
source record produce totalThe total number of records produced (before transformation) by this task belonging to the named source connector in this workerkafka.connect:type=source-task-metrics,name=source-record-produce-total,worker=([-.\w]+)l,connector=([-.\w]+),task=([\d]+)
source record write rateThe 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 transformation and excludes any records filtered out by the transformations.kafka.connect:type=source-task-metrics,name=source-record-produce-rate,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
source record write totalThe total number of records output from the transformations and written to Kafka by this task belonging to the named source connector in this worker. This is after transformation and excludes any records filtered out by the transformations.kafka.connect:type=source-task-metrics,name=source-record-produce-total,worker=([-.\w]+)l,connector=([-.\w]+),task=([\d]+)
poll time percentageThe average percentage of time spent polling this task belonging to the named source connector in this workerkafka.connect:type=source-task-metrics,name=poll-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
transform time percentageThe average percentage of time spent transforming source records for this task belonging to the named source connector in this workerkafka.connect:type=source-task-metrics,name=transform-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
write time percentageThe average percentage of time spent converting and writing source records for this task belonging to the named source connector in this workerkafka.connect:type=source-task-metrics,name=write-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
pause time percentageThe average percentage of time this task belonging to the named source connector in this worker were pausedkafka.connect:type=source-task-metrics,name=pause-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)


Source Connector Metrics

Metric NameDescriptionMBean attribute
connector classThe name of the connector classkafka.connect:type=source-connector-metrics,name=connector-class,worker=([-.\w]+),connector=([-.\w]+)
connector versionThe version of the connector class, as reported by the connector in this workerkafka.connect:type=source-connector-metrics,name=connector-version,worker=([-.\w]+),connector=([-.\w]+)
source record rateThe number of records produced per second by all tasks belonging to the named source connector in this workerkafka.connect:type=source-connector-metrics,name=source-record-rate,worker=([-.\w]+),connector=([-.\w]+)
source record totalThe total number of records produced by all tasks belonging to the named source connector in this workerkafka.connect:type=source-connector-metrics,name=source-record-total,worker=([-.\w]+),connector=([-.\w]+)
poll time percentageThe average percentage of time this worker spent polling all tasks belonging to the named source connectorkafka.connect:type=source-connector-metrics,name=poll-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
transform time percentageThe average percentage of time this worker spent transforming source records for all tasks belonging to the named source connectorkafka.connect:type=source-connector-metrics,name=transform-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
write time percentageThe average percentage of time this worker spent converting and writing source records for all tasks belonging to the named source connectorkafka.connect:type=source-connector-metrics,name=write-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
pause time percentageThe average percentage of time all tasks in this worker belonging to the named source connector were pausedkafka.connect:type=source-connector-metrics,name=pause-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
 statusThe current status of the connector in this worker, one of: running, paused, stopped  kafka.connect:type=source-connector-metrics,name=status,worker=([-.\w]+),connector=([-.\w]+)

 

Sink Task Metrics

 

Metric NameDescriptionMBean attribute
sink record read rateThe number of records per second read from Kafka for this task belonging to the named sink connector in this worker. This includes all records passed to the transformations.kafka.connect:type=sink-task-metrics,name=sink-record-read-rate,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
sink record read totalThe total number of records read from Kafka for this task belonging to the named sink connector in this worker. This includes all records passed to the transformations.kafka.connect:type=sink-task-metrics,name=sink-record-read-total,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
sink record process rateThe number of records per second output from the transformations and sent to this task belonging to the named sink connector in this worker. This is after transformation and excludes any records filtered out by the transformations.kafka.connect:type=sink-task-metrics,name=sink-record-process-rate,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
sink record process totalThe total number of records output from the transformations and sent to this task belonging to the named sink connector in this worker. This is after transformation and excludes any records filtered out by the transformations.kafka.connect:type=sink-task-metrics,name=sink-record-process-total,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
read time percentageThe average percentage of time spent polling this task belonging to the named source connector in this workerkafka.connect:type=sink-task-metrics,name=read-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
transform time percentageThe average percentage of time spent transforming sink records for this task belonging to the named sink connector in this workerkafka.connect:type=sink-task-metrics,name=transform-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
put time percentageThe average percentage of time this task belonging to the named sink connector in this worker spent putting/processing sink recordskafka.connect:type=sink-task-metrics,name=put-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
flush time percentageThe average percentage of time this task belonging to the named sink connector in this worker spent flushing sink recordskafka.connect:type=sink-task-metrics,name=flush-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)
pause time percentageThe average percentage of time this task belonging to the named sink connector in this worker were pausedkafka.connect:type=sink-task-metrics,name=pause-time-percentage,worker=([-.\w]+),connector=([-.\w]+),task=([\d]+)


Sink Connector Metrics

 

Metric NameDescriptionMBean attribute
connector classThe name of the connector classkafka.connect:type=sink-connector-metrics,name=connector-class,worker=([-.\w]+),connector=([-.\w]+)
connector versionThe version of the connector class, as reported by the connector in this workerkafka.connect:type=sink-connector-metrics,name=connector-version,worker=([-.\w]+),connector=([-.\w]+)
sink record rateThe number of records produced per second in this worker by all tasks belonging to the named source connectorkafka.connect:type=sink-connector-metrics,name=sink-record-rate,worker=([-.\w]+),connector=([-.\w]+)
sink record totalThe total number of records produced in this worker by all tasks belonging to the named source connectorkafka.connect:type=sink-connector-metrics,name=sink-record-total,worker=([-.\w]+),connector=([-.\w]+)
read time percentageThe average percentage of time this worker spent polling all tasks belonging to the named source connectorkafka.connect:type=sink-connector-metrics,name=read-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
transform time percentageThe average percentage of time this worker spent transforming sink records for all tasks belonging to the named sink connectorkafka.connect:type=sink-connector-metrics,name=transform-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
put time percentageThe average percentage of time all tasks belonging to the named sink connector in this worker spent putting/processing sink recordskafka.connect:type=sink-connector-metrics,name=put-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
flush time percentageThe average percentage of time all tasks belonging to the named sink connectorin this worker spent flushing sink recordskafka.connect:type=sink-connector-metrics,name=flush-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
pause time percentageThe average percentage of time all tasks belonging to the named sink connector in this worker were pausedkafka.connect:type=sink-connector-metrics,name=pause-time-percentage,worker=([-.\w]+),connector=([-.\w]+)
statusThe current status of the connector in this worker, one of: running, paused, stopped  kafka.connect:type=sink-connector-metrics,name=status,worker=([-.\w]+),connector=([-.\w]+)
partition countThe number of topic partitions assigned to all tasks running in this worker for the named sink connectorkafka.connect:type=sink-connector-metrics,name=partition-count,worker=([-.\w]+),connector=([-.\w]+)


Worker Metrics

 

Metric NameDescriptionMBean attribute

assigned tasks

The number of tasks run in this worker (copy of existing metric)kafka.connect:type=connect-worker-metrics,name=assigned-tasks,worker=([-.\w]+)
assigned connectorsThe number of connectors run in this worker (copy of existing metric)kafka.connect:type=connect-worker-metrics,name=assigned-connectors,worker=([-.\w]+)

task count

The number of tasks run in this workerkafka.connect:type=connect-worker-metrics,name=task-count,worker=([-.\w]+)
connector countThe number of connectors run in this workerkafka.connect:type=connect-worker-metrics,name=connector-count,worker=([-.\w]+)
sink record rateThe number of sink records consumed per second by all sink connectors in this workerkafka.connect:type=connect-worker-metrics,name=sink-record-rate,worker=([-.\w]+)
sink record totalThe total number of sink records consumed by all sink connector in this workerkafka.connect:type=connect-worker-metrics,name=sink-record-total,worker=([-.\w]+)
source record rateThe number of source records produced per second by all source connectors in this workerkafka.connect:type=connect-worker-metrics,name=source-record-rate,worker=([-.\w]+)
source record totalThe total number of source records produced by all source connector in this workerkafka.connect:type=connect-worker-metrics,name=source-record-total,worker=([-.\w]+)
leader nameThe name of the group leaderkafka.connect:type=connect-worker-metrics,name=leader-name,worker=([-.\w]+)
stateThe state of this worker, one of: rebalancing, runningkafka.connect:type=connect-worker-metrics,name=state,worker=([-.\w]+)
offset commit success totalThe total number of this worker's successful offset commitskafka.connect:type=connect-worker-metrics,name=offset-commit-success-total,worker=([-.\w]+)
offset commit success percentageThe average percentage of this worker's offset commits that succeededkafka.connect:type=connect-worker-metrics,name=offset-commit-success-percentage,worker=([-.\w]+)
offset commit failure totalThe total number of this worker's failed offset commitskafka.connect:type=connect-worker-metrics,name=offset-commit-failure-total,worker=([-.\w]+)
offset commit failure percentageThe average percentage of this worker's offset commits that failedkafka.connect:type=connect-worker-metrics,name=offset-commit-failure-percentage,worker=([-.\w]+)
offset commit totalThe total number of this worker's offset commitskafka.connect:type=connect-worker-metrics,name=offset-commit-total,worker=([-.\w]+)
offset commit maximum timeThe maximum time this worker spent to commit offsetskafka.connect:type=connect-worker-metrics,name=offset-commit-max-time,worker=([-.\w]+)
offset commit 99th percentile timeThe 99th percentile time spent by this worker to commit offsets during the last window (defaults to an hour)kafka.connect:type=connect-worker-metrics,name=offset-commit-99p-time,worker=([-.\w]+)
offset commit 95th percentile timeThe 95th percentile time spent by this worker to commit offsets during the last window (defaults to an hour)kafka.connect:type=connect-worker-metrics,name=offset-commit-95p-time,worker=([-.\w]+)
offset commit 90th percentile timeThe 90th percentile time spent by this worker to commit offsets during the last window (defaults to an hour)kafka.connect:type=connect-worker-metrics,name=offset-commit-90p-time,worker=([-.\w]+)
offset commit 75th percentile timeThe 75th percentile time spent by this worker to commit offsets during the last window (defaults to an hour)kafka.connect:type=connect-worker-metrics,name=offset-commit-75p-time,worker=([-.\w]+)


Worker Rebalance Metrics

Metric NameDescriptionMBean attribute
rebalance success totalThe total number of this worker's successful rebalanceskafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-success-total,worker=([-.\w]+)
rebalance success percentageThe average percentage of this worker's rebalances that succeededkafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-success-percentage,worker=([-.\w]+)
rebalance failure totalThe total number of this worker's failed rebalanceskafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-failure-total,worker=([-.\w]+)
rebalance failure percentageThe average percentage of this worker's rebalances that failedkafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-failure-percentage,worker=([-.\w]+)
rebalance maximum timeThe maximum time spent by this worker to rebalancekafka.connect:type=connect-worker-rebalance-metrics,name=rebalance-max-time,worker=([-.\w]+)
rebalance 99th percentile 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-time,worker=([-.\w]+)
rebalance 95th percentile 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-95p-time,worker=([-.\w]+)
rebalance 90th percentile 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,worker=([-.\w]+)
rebalance 75th percentile 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,worker=([-.\w]+)
time since last rebalanceThe time since the most recent rebalance in this workerkafka.connect:type=connect-worker-rebalance-metrics,name=time-since-last-rebalance,worker=([-.\w]+)
task failure rateThe number of tasks that failed in this workerkafka.connect:type=connect-worker-rebalance-metrics,name=task-failure-rate,worker=([-.\w]+


Worker REST Metrics

Metric NameDescriptionMBean attribute
REST request rateThe number of requests handled by the REST endpoints in this workerkafka.connect:type=worker-rest-metrics,name=request-rate,worker=([-.\w]+)

 

Proposed Changes

We will add the relevant metrics as specified in the Public Interfaces section. The scope of each metric is limited by a single worker, and these metrics can be aggregated across workers; this is why the worker name is included in all MBean attributes.

Compatibility, Deprecation, and Migration Plan

Two existing metrics exist but will not be changed. However, these new metrics use slightly different patterns for the MBean attributes to always include the worker name, new metrics will be added to replicate these existing metrics with the new naming pattern.

Rejected Alternatives

None


  • No labels