talatuyarer commented on PR #25554:
URL: https://github.com/apache/beam/pull/25554#issuecomment-1447818939

   > If I understand that correctly (and I'm definitely not sure about that 
:)), then you refer to the time when metrics are compute in the source 
(KafkaSource in this case). But the wrapper should update the metric container 
on each call to `advance`, see [1]. I wonder why it is needed to do the same 
when doing checkpoint (though it sort might make more sense than to do that on 
each call to `advance()`).- I'm not saying it is wrong, I'd just like to 
understand the reason.
   
   Backlog is reported from getCheckpointMark(), which is done by some other 
thread. Not sure why it is done there. But this is the main issue. Advance 
function runs on main thread and it has Metric context so I am able to see 
element count metrics. However Checkpoint thread does not have context thats 
why It can not emit metrics. 
   
   If I move reportBacklog() function in advance function i am able to see 
backlog metrics too. We could do that in advance(), but that would unnecessary 
overhead for every single record. I am not suggesting to do everything in 
advance(), it was merely a test for me to verify the problem.  :) 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to