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

instr(kafka): Tag producer error metric with topic #3189

Merged
merged 1 commit into from
Mar 1, 2024
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
instr(kafka): Tag producer error metric with topic
jjbayer committed Mar 1, 2024
commit aaaf2e801901950907b33a6858121b28bded674d
5 changes: 4 additions & 1 deletion relay-kafka/src/producer/utils.rs
Original file line number Diff line number Diff line change
@@ -26,7 +26,10 @@ impl ProducerContext for CaptureErrorContext {
"failed to produce message to Kafka (delivery callback)",
);

metric!(counter(KafkaCounters::ProcessingProduceError) += 1);
metric!(
counter(KafkaCounters::ProcessingProduceError) += 1,
topic = message.topic()
);
}
}
}
3 changes: 3 additions & 0 deletions relay-kafka/src/statsd.rs
Original file line number Diff line number Diff line change
@@ -7,6 +7,9 @@ pub enum KafkaCounters {
/// These errors include, for example, _"MessageTooLarge"_ errors when the broker does not
/// accept the requests over a certain size, which is usually due to invalid or inconsistent
/// broker/producer configurations.
///
/// This metric is tagged with:
/// - `topic`: The Kafka topic being produced to.
ProcessingProduceError,
}

Loading