[
https://issues.apache.org/jira/browse/BEAM-4521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16507751#comment-16507751
]
Jozef Vilcek commented on BEAM-4521:
------------------------------------
[~rangadi], after little bit of looking around metrics environemnt, yes, it
does seems like Runner should be able to provide context for the checkpointing
operation. Will see what they can find.
I am not suggesting to do everything in advance(), it was merely a test for me
to verify the problem. But it is true that half of the backlog reporting
(backlogMessageCount) is already being materialised for TimestampPolicyContext
every time advance() is called.
> Backlog metrics not showing up
> ------------------------------
>
> Key: BEAM-4521
> URL: https://issues.apache.org/jira/browse/BEAM-4521
> Project: Beam
> Issue Type: Bug
> Components: runner-flink
> Affects Versions: 2.4.0
> Reporter: Jozef Vilcek
> Assignee: Aljoscha Krettek
> Priority: Minor
>
> Hello,
> I wanted to track _backlog_bytes_ and _backlog_elements_ metrics from
> SinkMetrics for kafka. I see in the code that KafkaUnboundedReader is
> reporting them but was not able to get them visible (running on Flink).
> Metrics are reported here:
> [https://github.com/apache/beam/blob/master/sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaUnboundedReader.java#L668]
> In Flink runtime I noticed this message:
> {code:java}
> 2018-06-07 08:53:53,216 ERROR org.apache.beam.sdk.metrics.MetricsEnvironment
> - Unable to update metrics on the current thread. Most likely
> caused by using metrics outside the managed work-execution thread.
> {code}
> I see that backlog is reported from getCheckpointMark(), which is done by
> some other thread. Not sure why it is done there.
> I tested locally to move it to the advance() method, where bytes_read is
> reported and it worked.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)