mobuchowski commented on code in PR #65677:
URL: https://github.com/apache/airflow/pull/65677#discussion_r3147537497


##########
providers/openlineage/src/airflow/providers/openlineage/plugins/listener.py:
##########
@@ -81,6 +81,19 @@ def _executor_initializer():
     settings.configure_orm()
 
 
+def _emit_manual_state_change_event(adapter_method, stats_key, **kwargs):
+    """
+    Emit an OL event via the given adapter method and record its serialized 
size.
+
+    Module-level so it is picklable across the ProcessPoolExecutor boundary 
used by
+    `_on_task_instance_manual_state_change` for scheduler-side "task state 
changed
+    externally" emissions.
+    """
+    event = adapter_method(**kwargs)
+    Stats.gauge(stats_key, len(Serde.to_json(event).encode("utf-8")))

Review Comment:
   Thanks, this was actual issue - fixed by initializing stats in the 
`_executor_initializer`



-- 
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