-
Notifications
You must be signed in to change notification settings - Fork 92
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): Improve produce error handling #3351
Conversation
Include the name of the topic in the log message when `producer.send` fails. Report a metric for the number of Kafka messages that fail to enqueue.
Hi, this is my first time contributing to Relay. I have not yet tested these changes. Can you please advise on what tests I should perform before merging this? Thanks! |
relay-kafka/src/producer/mod.rs
Outdated
@@ -402,7 +402,12 @@ impl Producer { | |||
relay_log::error!( | |||
error = &error as &dyn std::error::Error, | |||
tags.variant = variant, | |||
"error sending kafka message" | |||
"error sending kafka message to topic {}", | |||
topic_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of changing the name, please, add the topic name into the tags. E.g.
relay_log::error!(
error = &error as &dyn std::error::Error,
tags.variant = variant,
tags.topic = topic_name,
"error sending kafka message"
@@ -402,7 +402,12 @@ impl Producer { | |||
relay_log::error!( | |||
error = &error as &dyn std::error::Error, | |||
tags.variant = variant, | |||
"error sending kafka message" | |||
tags.topic = topic_name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, the error was already tagged by variant
, which describes what data type was dropped (e.g. "metric"
).
); | ||
metric!( | ||
counter(KafkaCounters::ProducerEnqueueError) += 1, | ||
topic = topic_name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jjbayer do we wanna also tag this with the variant? I can PR that.
* master: ref(cardinality): Pipeline Redis script invocations (#3321) ref(normalization): Remove StoreProcessor (#3097) feat(cardinality): Implement name based cardinality limits (#3313) instr(kafka): Tag existing metrics with variant (#3352) instr(kafka): More broker stats (#3349) instr(kafka): Improve produce error handling (#3351) feat(schema): Allow integers as username (#3328)
producer.send
fails.See INC-696 for the motivation behind these changes.
#skip-changelog