From 39f732520120eb5fdda700bebada116125c6514b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez=20Mondrag=C3=B3n?= <16805946+edgarrmondragon@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:02:24 -0600 Subject: [PATCH] feat: Targets now emit record count from the built-in batch file processor (#2703) --- singer_sdk/sinks/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/singer_sdk/sinks/core.py b/singer_sdk/sinks/core.py index c417c650b..5070655d4 100644 --- a/singer_sdk/sinks/core.py +++ b/singer_sdk/sinks/core.py @@ -752,6 +752,7 @@ def process_batch_files( } else: context = {"records": [deserialize_json(line) for line in file]} + self.record_counter_metric.increment(len(context["records"])) self.process_batch(context) elif ( importlib.util.find_spec("pyarrow") @@ -765,6 +766,7 @@ def process_batch_files( ): table = pq.read_table(file) context = {"records": table.to_pylist()} + self.record_counter_metric.increment(len(context["records"])) self.process_batch(context) else: msg = f"Unsupported batch encoding format: {encoding.format}"