You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kacpermuda (via GitHub)" <gi...@apache.org> on 2024/03/01 09:00:26 UTC
Re: [PR] [OpenLineage] feat: Add metrics for event_size and extraction time [airflow]
kacpermuda commented on code in PR #37797:
URL: https://github.com/apache/airflow/pull/37797#discussion_r1507800926
##########
airflow/providers/openlineage/plugins/adapter.py:
##########
@@ -117,13 +117,19 @@ def build_task_instance_run_id(dag_id, task_id, execution_date, try_number):
)
)
- def emit(self, event: RunEvent):
+ def emit(self, event: RunEvent) -> RunEvent:
+ """Emit OpenLineage event.
+
+ :param event: Event to be emitted.
+ :return: Redacted Event.
+ """
if not self._client:
self._client = self.get_or_create_openlineage_client()
redacted_event: RunEvent = self._redacter.redact(event, max_depth=20) # type: ignore[assignment]
try:
- with Stats.timer("ol.emit.attempts"):
- return self._client.emit(redacted_event)
+ with Stats.timer(f"ol.emit.attempts.{event.eventType.value}.{self._client.transport.kind}"):
+ self._client.emit(redacted_event)
+ return redacted_event
Review Comment:
Was thinking about passing just a gauge or a task_type, but returning whole event seems more future proof ? I don't have any specific use case in mind tho
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org