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

Compare with Current View Page History

« Previous Version 16 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. Although producers and consumers used in Kafka Connect can be monitored, the Kafka Connect framework only has a few metrics capturing the number of connectors and tasks for each worker. To augment these existing metrics, we propose to add metrics to monitor more information about the connectors, tasks, and workers. All metrics reported by each worker are scoped by the activities within that worker.

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 across 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 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/Attribute NameDescription
connector-typeThe type of the connector, one of: source, sink
connector-classThe name of the connector class
connector-versionThe version of the connector class, as reported by the connector in this worker
statusThe current status of the connector in this worker, one of: running, paused, stopped 

Common Task Metrics

MBean namekafka.connect:type=task-metrics,connector=([-.\w]+)


Metric/Attribute NameDescription
statusThe current status of this task, one of: unassigned, running, paused, failed, destroyed
pause-ratioThe fraction of time this task has spent in the paused state.
offset-commit-success-percentageThe average percentage of this task's offset commit attempts that succeeded
offset-commit-failure-percentageThe average percentage of this task's offset commit attempts that failed or had an error
offset-commit-max-timeThe maximum time taken by this task to commit offsets
offset-commit-99p-timeThe 99th percentile time spent by this task to commit offsets to Kafka
offset-commit-95p-timeThe 95th percentile time spent by this task to commit offsets to Kafka
offset-commit-90p-timeThe 90th percentile time spent by this task to commit offsets to Kafka
offset-commit-75p-timeThe 75th percentile time spent by this task to commit offsets to Kafka
offset-commit-50p-timeThe 50th percentile (average) time spent by this task to commit offsets to Kafka
batch-size-maxThe maximum size of the batches processed by the connector
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]+)


Metric/Attribute NameDescription
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.
source-record-write-rateThe average per-second number of records 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]+)


Metric/Attribute NameDescription
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.
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.
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.
commit-seq-noThe current sequence number for commits
commit-completion-rateThe average per-second number of commit completions that were completed successfully
commit-completion-skip-rateThe average per-second number of commit completions that were recieved too late and skipped/ignored
offset-commit-max-timeThe maximum time taken by this sink task to pre-commit offsets to the sink
offset-commit-99p-timeThe 99th percentile time spent by this sink task to pre-commit offsets to the sink
offset-commit-95p-timeThe 95th percentile time spent by this sink task to pre-commit offsets to the sink
offset-commit-90p-timeThe 90th percentile time spent by this sink task to pre-commit offsets to the sink
offset-commit-75p-timeThe 75th percentile time spent by this sink task to pre-commit offsets to the sink
offset-commit-50p-timeThe 50th percentile (average) time spent by this sink task to pre-commit offsets to the sink


MBean namekafka.connect:type=sink-task-metrics,connector=([-.\w]+),task=([\d]+),topic=([-.\w]+),partition=([\d]+)


Metric/Attribute NameDescription
sink-record-lagThe latest lag in terms of number of records behind the consumer the offset commits are for the topic partition.
sink-record-lag-avgThe average lag in terms of number of records behind the consumer the offset commits are for the topic partition.
sink-record-lag-maxThe 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]+)


Metric/Attribute NameDescription

assigned-tasks

The number of tasks run in this worker (mirrors existing metric)
assigned-connectorsThe number of connectors run in this worker (mirrors existing metric)

task-count

The number of tasks run in this worker
connector-countThe number of connectors run in this worker
leader-nameThe name of the group leader
epochThe epoch or generation number of this worker
stateThe state of this worker, one of: rebalancing, running
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]+)


Metric/Attribute NameDescription
rebalance-success-totalThe total number of this worker's successful rebalances
rebalance-success-percentageThe average percentage of this worker's rebalances that succeeded
rebalance-failure-totalThe total number of this worker's failed rebalances
rebalance-failure-percentageThe average percentage of this worker's rebalances that failed
rebalance-max-timeThe maximum time spent by this worker to rebalance
rebalance-99p-timeThe 99th percentile time spent by this worker to rebalance during the last window (defaults to an hour)
rebalance-95p-timeThe 95th percentile time spent by this worker to rebalance during the last window (defaults to an hour)
rebalance-90p-timeThe 90th percentile time spent by this worker to rebalance during the last window (defaults to an hour)
rebalance-75p-timeThe 75th percentile time spent by this worker to rebalance during the last window (defaults to an hour)
rebalance-50p-timeThe 50th percentile (average) time spent by this worker to rebalance during the last window (defaults to an hour)
time-since-last-rebalanceThe time since the most recent rebalance in this worker
task-failure-rateThe number of tasks that failed in this worker

Proposed Changes

We will add the relevant metrics as specified in the Public Interfaces section.

Compatibility, Deprecation, and Migration Plan

Two existing metrics exist but will not be changed.

Rejected Alternatives

None


The average per-second number of retried record sends for a topic.

  • No labels