Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add batch duration metric for ingestion consumer loop #18879

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plugin-server/src/kafka/batch-consumer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ export const startBatchConsumer = async ({
batchesProcessed += 1

const processingTimeMs = new Date().valueOf() - startProcessingTimeMs
consumedBatchDuration.labels({ topic, groupId }).observe(processingTimeMs)
if (processingTimeMs > SLOW_BATCH_PROCESSING_LOG_THRESHOLD_MS) {
status.warn(
'🕒',
Expand Down Expand Up @@ -293,6 +294,12 @@ export const startBatchConsumer = async ({
return { isHealthy, stop, join, consumer }
}

export const consumedBatchDuration = new Histogram({
name: 'consumed_batch_duration_ms',
help: 'Main loop consumer batch processing duration in ms',
labelNames: ['topic', 'groupId'],
})

export const consumerBatchSize = new Histogram({
name: 'consumed_batch_size',
help: 'Size of the batch fetched by the consumer',
Expand Down
Loading