Skip to content

KAFKA-20612: Add DLQ related metrics to ShareGroupMetrics. [1/N]#22382

Merged
apoorvmittal10 merged 2 commits into
apache:trunkfrom
smjn:KAFKA-20612
May 27, 2026
Merged

KAFKA-20612: Add DLQ related metrics to ShareGroupMetrics. [1/N]#22382
apoorvmittal10 merged 2 commits into
apache:trunkfrom
smjn:KAFKA-20612

Conversation

@smjn
Copy link
Copy Markdown
Collaborator

@smjn smjn commented May 27, 2026

  • Added data structures and metrics defined in KIP-1191. These will be
    invoked by the share group DLQ manager.

Reviewers: Apoorv Mittal apoorvmittal10@gmail.com

@smjn smjn requested a review from apoorvmittal10 May 27, 2026 09:50
@github-actions github-actions Bot added triage PRs from the community core Kafka Broker small Small PRs labels May 27, 2026
@smjn smjn added KIP-932 Queues for Kafka ci-approved labels May 27, 2026
Copy link
Copy Markdown
Contributor

@apoorvmittal10 apoorvmittal10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, lgtm. Minor suggestions.

public void recordDLQProduceFailed(String shareGroupId) {
dlqProduceFailedPerGroup.computeIfAbsent(shareGroupId, k -> metricsGroup.newMeter(
DEAD_LETTER_QUEUE_FAILED_PRODUCE_REQ_PER_SEC,
"dlq-produce",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be better to classify this as errors?

Suggested change
"dlq-produce",
"errors",

public void recordDLQRecordWrite(String shareGroupId, int count) {
dlqRecordCountPerGroup.computeIfAbsent(shareGroupId, k -> metricsGroup.newMeter(
DEAD_LETTER_QUEUE_RECORD_COUNT,
"dlq-records",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be better to classify this as requests?

Suggested change
"dlq-records",
"requests",

public void recordDLQProduce(String shareGroupId) {
dlqProduceTotalPerGroup.computeIfAbsent(shareGroupId, k -> metricsGroup.newMeter(
DEAD_LETTER_QUEUE_TOTAL_PRODUCE_REQ_PER_SEC,
"dlq-produce",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be better to classify this as requests?

Suggested change
"dlq-produce",
"requests",

Comment on lines -135 to -136
topicPartitionsFetchRatio.forEach((k, v) -> metricsGroup.removeMetric(TOPIC_PARTITIONS_FETCH_RATIO, Map.of("group", k)));
topicPartitionsAcquireTimeMs.forEach((k, v) -> metricsGroup.removeMetric(TOPIC_PARTITIONS_ACQUIRE_TIME_MS, Map.of("group", k)));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also change the string "group" to GROUP_ID_TAG in other places in the file.

private static final String DEAD_LETTER_QUEUE_RECORD_COUNT = "DeadLetterQueueRecordCount";
private static final String DEAD_LETTER_QUEUE_TOTAL_PRODUCE_REQ_PER_SEC = "DeadLetterQueueTotalProduceRequestsPerSec";
private static final String DEAD_LETTER_QUEUE_FAILED_PRODUCE_REQ_PER_SEC = "DeadLetterQueueFailedProduceRequestsPerSec";
private static final String GROUP_ID_TAG = "group";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Move the GROUP_ID_TAG and ACK_TYPE_TAG together for readability separated by a line from metrics defined together.

@smjn
Copy link
Copy Markdown
Collaborator Author

smjn commented May 27, 2026

@apoorvmittal10 Thanks for the quick review - inc comments

@smjn smjn requested a review from apoorvmittal10 May 27, 2026 11:00
Copy link
Copy Markdown
Contributor

@apoorvmittal10 apoorvmittal10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@apoorvmittal10 apoorvmittal10 merged commit 80ee0a9 into apache:trunk May 27, 2026
22 checks passed
@github-actions github-actions Bot removed the triage PRs from the community label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved core Kafka Broker KIP-932 Queues for Kafka small Small PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants