-
Notifications
You must be signed in to change notification settings - Fork 591
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
bug: kafka consuer lag size metrics are not dropped after related actors are dropped #16064
Comments
The difficulty lies in that certain labels have the same lifetime as the owner's, but some specific labels are random and do not have a clear lifetime relationship. 🤔 e.g. For impl KafkaSplitReader {
fn report_latest_message_id(&self, split_id: &str, offset: i64) {
self.source_ctx
.metrics
.latest_message_id
.with_label_values(&[
// source name is not available here
&self.source_ctx.source_id.to_string(),
&self.source_ctx.actor_id.to_string(),
split_id,
])
.set(offset);
}
} But the last label is decided by its received message. #[for_await]
'for_outer_loop: for msgs in self.consumer.stream().ready_chunks(max_chunk_size) {
let msgs: Vec<_> = msgs
.into_iter()
.collect::<std::result::Result<_, KafkaError>>()?;
// ... ...
for (partition, offset) in split_msg_offsets {
let split_id = partition.to_string();
self.report_latest_message_id(&split_id, offset);
} |
@wangrunji0408 may be facing the same problem. |
Should we introduce a new metrics guard that holds a label map internally? |
For simplicity, we can maintain a map in |
This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned. |
Describe the bug
Some source related metrics (e.g.
source_latest_message_id
,source_kafka_high_watermark
, and maybe more) are not dropped after related actors are dropped. UseLabelGuardedMetrics
instead to automatically drop the metrics.Error message/log
No response
To Reproduce
No response
Expected behavior
Source related metrics should be dropped after the related actors are dropped.
How did you deploy RisingWave?
No response
The version of RisingWave
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: