Skip to main content

consumers_lags

Creates, updates, deletes, gets or lists a consumers_lags resource.

Overview

Nameconsumers_lags
TypeResource
Idconfluent.kafka.consumers_lags

Fields

The following fields are returned by SELECT queries:

The consumer lag.

NameDatatypeDescription
client_idstring
cluster_idstring
consumer_group_idstring
consumer_idstring
instance_idstring
partition_idinteger
topic_namestring
current_offsetinteger (int64)
kindstring
laginteger (int64)
log_end_offsetinteger (int64)
metadataobject

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_kafka_consumer_lagselectcluster_id, consumer_group_id, topic_name, partition_id, kafka_endpoint_id, region, cloud_provider Return the consumer lag on a partition with the given partition_id.
list_kafka_consumer_lagsselectcluster_id, consumer_group_id, kafka_endpoint_id, region, cloud_provider Return a list of consumer lags of the consumers belonging to the
specified consumer group.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
cloud_providerstringCloud provider, lowercase: aws, gcp, or azure (from the cluster spec.cloud). (default: cloud)
cluster_idstringThe Kafka cluster ID. (example: cluster-1)
consumer_group_idstringThe consumer group ID. (example: consumer-group-1)
kafka_endpoint_idstringPer-cluster Kafka REST endpoint ID (the pkc-* host prefix from the Confluent UI Cluster -> Overview -> REST endpoint, or extract from confluent.managed_kafka_clusters.clusters spec.http_endpoint). (default: pkc-00000)
partition_idintegerThe partition ID. (example: 0)
regionstringCloud region the cluster runs in, e.g. ap-southeast-2 (from the cluster spec.region). (default: region)
topic_namestringThe topic name. (example: topic-1)

SELECT examples

Return the consumer lag on a partition with the given partition_id.

SELECT
client_id,
cluster_id,
consumer_group_id,
consumer_id,
instance_id,
partition_id,
topic_name,
current_offset,
kind,
lag,
log_end_offset,
metadata
FROM confluent.kafka.consumers_lags
WHERE cluster_id = '{{ cluster_id }}' -- required
AND consumer_group_id = '{{ consumer_group_id }}' -- required
AND topic_name = '{{ topic_name }}' -- required
AND partition_id = '{{ partition_id }}' -- required
AND kafka_endpoint_id = '{{ kafka_endpoint_id }}' -- required
AND region = '{{ region }}' -- required
AND cloud_provider = '{{ cloud_provider }}' -- required
;