You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Prateek Kohli <pr...@gmail.com> on 2023/10/20 08:26:50 UTC

File Source giving incorrect value for Source__File_Collector.numRecordsIn metric

Hi,

I want to capture the difference between the number of records collected by
the source and the number of records that are emitted.

When I use Kafka source and send 4 records, out of which 1 is corrupt(will
give decoding failure), I get the correct values for
Source__Kafka_collector.numRecordsIn(4) &
Source__Kafka_collector.numRecordsOut(3):

[image: image.png]


But in the same way, if I send 10 records to a File Source out of which 1
is corrupt(will give decoding failure), I get the correct value for
Source__File_Collector.numrecordsOut(9), but the value for
Source__File_Collector.numRecordIn(9) is incorrect.

*The value of Source__File_Collector.numRecordsIn metric should have been
10 as it read 10 records from a file.*

[image: image.png]

*Can this be a bug in FileSource?*
*Or is there any reason for this difference in the behavior of File & Kafka
Source?*

Regards,
Prateek Kohli

Re: File Source giving incorrect value for Source__File_Collector.numRecordsIn metric

Posted by Prateek Kohli <pr...@gmail.com>.
Hi All,

Please help with the below query.

Regards,
Prateek Kohli

On Fri, Oct 20, 2023 at 1:56 PM Prateek Kohli <pr...@gmail.com>
wrote:

> Hi,
>
> I want to capture the difference between the number of records collected
> by the source and the number of records that are emitted.
>
> When I use Kafka source and send 4 records, out of which 1 is corrupt(will
> give decoding failure), I get the correct values for
> Source__Kafka_collector.numRecordsIn(4) &
> Source__Kafka_collector.numRecordsOut(3):
>
> [image: image.png]
>
>
> But in the same way, if I send 10 records to a File Source out of which 1
> is corrupt(will give decoding failure), I get the correct value for
> Source__File_Collector.numrecordsOut(9), but the value for
> Source__File_Collector.numRecordIn(9) is incorrect.
>
> *The value of Source__File_Collector.numRecordsIn metric should have been
> 10 as it read 10 records from a file.*
>
> [image: image.png]
>
> *Can this be a bug in FileSource?*
> *Or is there any reason for this difference in the behavior of File &
> Kafka Source?*
>
> Regards,
> Prateek Kohli
>