From 8d8e032066c06449e22b4704cc78f5e5ca1c50f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20Ram=C3=ADrez-Mondrag=C3=B3n?= Date: Thu, 3 Oct 2024 20:14:01 -0600 Subject: [PATCH] feat: Targets now emit record count from the built-in batch file processor --- 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 10c278ccb..7bbed6497 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( ) as file: 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}"