OpenLineage: [BUG]: Airflow unable to detect custom open lineage transport
Details:
Apache Airflow Version
2.7.2
Docker Version
3.7
What happened
Hello there we’ve created a custom http transport for an endpoint we made, and have been having trouble testing the open lineage emit. We are running airflow through a containerized version through docker. Airflow is able to startup successfully and run DAGs as well. However, after we run the dag job, it attempts to emit to our endpoint via the custom transport. While that occurs, it seems to not detect our custom transport. We followed the documentation for both open lineage and airflow, but it hasn’t worked. We tested the endpoint separately on our own, which functions correctly, but fails with airflow. We would like to have some pointers on how to integrate it with airflow, or if it is even supported?
Here is our openlineage.yml
transport:
type: "custom_http"
module: "custom_http_transport"
className: "CustomHttpTransport"
url: "http://localhost:5000"
endpoint: "/api/v1/lineage"
Here is what the logs output after a run:
250ba5775545
*** Found local files:
*** * /home/airflow/airflow/logs/dag_id=python_operator_example/run_id=scheduled__2024-01-24T00:00:00+00:00/task_id=print_to_logs/attempt=1.log
[2024-07-24T21:13:59.180+0000] {taskinstance.py:1094} DEBUG - previous_execution_date was called
[2024-07-24T21:13:59.261+0000] {__init__.py:51} DEBUG - Loading core task runner: StandardTaskRunner
[2024-07-24T21:13:59.481+0000] {taskinstance.py:1094} DEBUG - previous_execution_date was called
[2024-07-24T21:13:59.529+0000] {base_task_runner.py:68} DEBUG - Planning to run as the user
[2024-07-24T21:13:59.555+0000] {taskinstance.py:844} DEBUG - Refreshing TaskInstance <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> from DB
[2024-07-24T21:13:59.713+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Task Instance State' PASSED: True, Task state queued was valid.
[2024-07-24T21:13:59.713+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Task Instance Not Running' PASSED: True, Task is not in running state.
[2024-07-24T21:13:59.713+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Not In Retry Period' PASSED: True, The task instance was not marked for retrying.
[2024-07-24T21:13:59.715+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Trigger Rule' PASSED: True, The task instance did not have any upstream tasks.
[2024-07-24T21:13:59.715+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Previous Dagrun State' PASSED: True, The task did not have depends_on_past set.
[2024-07-24T21:13:59.724+0000] {taskinstance.py:1159} INFO - Dependencies all met for dep_context=non-requeueable deps ti=<TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]>
[2024-07-24T21:13:59.724+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Not In Retry Period' PASSED: True, The task instance was not marked for retrying.
[2024-07-24T21:13:59.759+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Pool Slots Available' PASSED: True, There are enough open slots in default_pool to execute the task
[2024-07-24T21:13:59.759+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Trigger Rule' PASSED: True, The task instance did not have any upstream tasks.
[2024-07-24T21:13:59.760+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Previous Dagrun State' PASSED: True, The task did not have depends_on_past set.
[2024-07-24T21:13:59.776+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]> dependency 'Task Concurrency' PASSED: True, Task concurrency is not set.
[2024-07-24T21:13:59.795+0000] {taskinstance.py:1159} INFO - Dependencies all met for dep_context=requeueable deps ti=<TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [queued]>
[2024-07-24T21:13:59.810+0000] {taskinstance.py:1361} INFO - Starting attempt 1 of 1
[2024-07-24T21:14:00.024+0000] {taskinstance.py:1382} INFO - Executing <Task(_PythonDecoratedOperator): print_to_logs> on 2024-01-24 00:00:00+00:00
[2024-07-24T21:14:00.167+0000] {standard_task_runner.py:57} INFO - Started process 1184 to run task
[2024-07-24T21:14:00.208+0000] {standard_task_runner.py:84} INFO - Running: ['airflow', 'tasks', 'run', 'python_operator_example', 'print_to_logs', 'scheduled__2024-01-24T00:00:00+00:00', '--job-id', '90', '--raw', '--subdir', 'DAGS_FOLDER/dags/random.py', '--cfg-path', '/tmp/tmpm2omorj8']
[2024-07-24T21:14:00.238+0000] {standard_task_runner.py:85} INFO - Job 90: Subtask print_to_logs
[2024-07-24T21:14:00.667+0000] {taskinstance.py:1094} DEBUG - previous_execution_date was called
[2024-07-24T21:14:00.679+0000] {task_command.py:416} INFO - Running <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [running]> on host 250ba5775545
[2024-07-24T21:14:00.682+0000] {taskinstance.py:844} DEBUG - Refreshing TaskInstance <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [running]> from DB
[2024-07-24T21:14:00.834+0000] {taskinstance.py:1094} DEBUG - previous_execution_date was called
[2024-07-24T21:14:00.893+0000] {taskinstance.py:925} DEBUG - Clearing XCom data
[2024-07-24T21:14:01.045+0000] {retries.py:93} DEBUG - Running RenderedTaskInstanceFields.write with retries. Try 1 of 3
[2024-07-24T21:14:01.425+0000] {retries.py:93} DEBUG - Running RenderedTaskInstanceFields._do_delete_old_records with retries. Try 1 of 3
[2024-07-24T21:14:01.588+0000] {taskinstance.py:1662} INFO - Exporting env vars: AIRFLOW_CTX_DAG_OWNER='airflow' AIRFLOW_CTX_DAG_ID='python_operator_example' AIRFLOW_CTX_TASK_ID='print_to_logs' AIRFLOW_CTX_EXECUTION_DATE='2024-01-24T00:00:00+00:00' AIRFLOW_CTX_TRY_NUMBER='1' AIRFLOW_CTX_DAG_RUN_ID='scheduled__2024-01-24T00:00:00+00:00'
[2024-07-24T21:14:01.589+0000] {__init__.py:116} DEBUG - Preparing lineage inlets and outlets
[2024-07-24T21:14:01.597+0000] {__init__.py:157} DEBUG - inlets: [], outlets: []
[2024-07-24T21:14:01.601+0000] {manager.py:150} DEBUG - extractor for _PythonDecoratedOperator is None
[2024-07-24T21:14:01.601+0000] {manager.py:109} DEBUG - Unable to find an extractor task_type=_PythonDecoratedOperator airflow_dag_id=python_operator_example task_id=print_to_logs airflow_run_id=scheduled__2024-01-24T00:00:00+00:00
[2024-07-24T21:14:01.923+0000] {utils.py:20} WARNING - not enough values to unpack (expected 2, got 1)
[2024-07-24T21:14:01.924+0000] {utils.py:408} WARNING - Transport None has to be class, and subclass of Transport
[2024-07-24T21:14:01.935+0000] {logging_mixin.py:151} INFO - {'conf': <airflow.configuration.AirflowConfigParser object at 0x7ffffb96dee0>, 'dag': <DAG: python_operator_example>, 'dag_run': <DagRun python_operator_example @ 2024-01-24 00:00:00+00:00: scheduled__2024-01-24T00:00:00+00:00, state:running, queued_at: 2024-07-24 21:13:55.082703+00:00. externally triggered: False>, 'data_interval_end': DateTime(2024, 1, 25, 0, 0, 0, tzinfo=Timezone('UTC')), 'data_interval_start': DateTime(2024, 1, 24, 0, 0, 0, tzinfo=Timezone('UTC')), 'ds_nodash': '20240124', 'execution_date': <Proxy at 0x7ffff34e9ac0 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'execution_date', DateTime(2024, 1, 24, 0, 0, 0, tzinfo=Timezone('UTC')))>, 'expanded_ti_count': None, 'inlets': [], 'logical_date': DateTime(2024, 1, 24, 0, 0, 0, tzinfo=Timezone('UTC')), 'macros': <module 'airflow.macros' from '/usr/local/lib/python3.9/dist-packages/airflow/macros/__init__.py'>, 'next_ds': <Proxy at 0x7ffff348edc0 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'next_ds', '2024-01-25')>, 'next_ds_nodash': <Proxy at 0x7ffff348ed40 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'next_ds_nodash', '20240125')>, 'next_execution_date': <Proxy at 0x7ffff348eb40 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'next_execution_date', DateTime(2024, 1, 25, 0, 0, 0, tzinfo=Timezone('UTC')))>, 'outlets': [], 'params': {}, 'prev_data_interval_start_success': DateTime(2024, 1, 18, 0, 0, 0, tzinfo=Timezone('UTC')), 'prev_data_interval_end_success': DateTime(2024, 1, 19, 0, 0, 0, tzinfo=Timezone('UTC')), 'prev_ds': <Proxy at 0x7ffff348eb00 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'prev_ds', '2024-01-23')>, 'prev_ds_nodash': <Proxy at 0x7ffff348ec80 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'prev_ds_nodash', '20240123')>, 'prev_execution_date': <Proxy at 0x7ffff348ea40 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'prev_execution_date', DateTime(2024, 1, 23, 0, 0, 0, tzinfo=Timezone('UTC')))>, 'prev_execution_date_success': <Proxy at 0x7ffff348e600 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'prev_execution_date_success', DateTime(2024, 1, 18, 0, 0, 0, tzinfo=Timezone('UTC')))>, 'prev_start_date_success': DateTime(2024, 7, 24, 21, 13, 46, 110447, tzinfo=Timezone('UTC')), 'run_id': 'scheduled__2024-01-24T00:00:00+00:00', 'task': <Task(_PythonDecoratedOperator): print_to_logs>, 'task_instance': <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [running]>, 'task_instance_key_str': 'python_operator_example__print_to_logs__20240124', 'test_mode': False, 'ti': <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [running]>, 'tomorrow_ds': <Proxy at 0x7ffff348e380 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'tomorrow_ds', '2024-01-25')>, 'tomorrow_ds_nodash': <Proxy at 0x7ffff348e300 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'tomorrow_ds_nodash', '20240125')>, 'triggering_dataset_events': <Proxy at 0x7ffff34ab1c0 with factory <function TaskInstance.get_template_context.<locals>.get_triggering_events at 0x7ffff351f3a0>>, 'ts': '2024-01-24T00:00:00+00:00', 'ts_nodash': '20240124T000000', 'ts_nodash_with_tz': '20240124T000000+0000', 'var': {'json': None, 'value': None}, 'conn': None, 'yesterday_ds': <Proxy at 0x7ffff348e280 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'yesterday_ds', '2024-01-23')>, 'yesterday_ds_nodash': <Proxy at 0x7ffff348e180 with factory functools.partial(<function lazy_mapping_from_context.<locals>._deprecated_proxy_factory at 0x7ffff34c4820>, 'yesterday_ds_nodash', '20240123')>, 'templates_dict': None}
[2024-07-24T21:14:01.936+0000] {logging_mixin.py:151} INFO - 2024-01-24
[2024-07-24T21:14:01.948+0000] {python.py:194} INFO - Done. Returned value was: Whatever you return gets printed in the logs
[2024-07-24T21:14:02.027+0000] {__init__.py:74} DEBUG - Lineage called with inlets: [], outlets: []
[2024-07-24T21:14:02.028+0000] {taskinstance.py:844} DEBUG - Refreshing TaskInstance <TaskInstance: python_operator_example.print_to_logs scheduled__2024-01-24T00:00:00+00:00 [running]> from DB
[2024-07-24T21:14:02.051+0000] {taskinstance.py:1458} DEBUG - Clearing next_method and next_kwargs.
[2024-07-24T21:14:02.053+0000] {taskinstance.py:1400} INFO - Marking task as SUCCESS. dag_id=python_operator_example, task_id=print_to_logs, execution_date=20240124T000000, start_date=20240724T211359, end_date=20240724T211402
[2024-07-24T21:14:02.054+0000] {taskinstance.py:2430} DEBUG - Task Duration set to 2.3273
[2024-07-24T21:14:02.406+0000] {manager.py:150} DEBUG - extractor for _PythonDecoratedOperator is None
[2024-07-24T21:14:02.407+0000] {manager.py:109} DEBUG - Unable to find an extractor task_type=_PythonDecoratedOperator airflow_dag_id=python_operator_example task_id=print_to_logs airflow_run_id=scheduled__2024-01-24T00:00:00+00:00
[2024-07-24T21:14:02.512+0000] {utils.py:20} WARNING - not enough values to unpack (expected 2, got 1)
[2024-07-24T21:14:02.513+0000] {utils.py:408} WARNING - Transport None has to be class, and subclass of Transport
[2024-07-24T21:14:02.665+0000] {local_task_job_runner.py:228} INFO - Task exited with return code 0
[2024-07-24T21:14:02.973+0000] {dagrun.py:734} DEBUG - number of tis tasks for <DagRun python_operator_example @ 2024-01-24 00:00:00+00:00: scheduled__2024-01-24T00:00:00+00:00, state:running, queued_at: 2024-07-24 21:13:55.082703+00:00. externally triggered: False>: 2 task(s)
[2024-07-24T21:14:02.973+0000] {dagrun.py:755} DEBUG - number of scheduleable tasks for <DagRun python_operator_example @ 2024-01-24 00:00:00+00:00: scheduled__2024-01-24T00:00:00+00:00, state:running, queued_at: 2024-07-24 21:13:55.082703+00:00. externally triggered: False>: 1 task(s)
[2024-07-24T21:14:02.974+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.random_number scheduled__2024-01-24T00:00:00+00:00 [None]> dependency 'Not In Retry Period' PASSED: True, The task instance was not marked for retrying.
[2024-07-24T21:14:03.004+0000] {taskinstance.py:1168} DEBUG - <TaskInstance: python_operator_example.random_number scheduled__2024-01-24T00:00:00+00:00 [None]> dependency 'Previous Dagrun State' PASSED: True, The task did not have depends_on_past set.
[2024-07-24T21:14:03.005+0000] {taskinstance.py:1159} DEBUG - Dependencies all met for dep_context=None ti=<TaskInstance: python_operator_example.random_number scheduled__2024-01-24T00:00:00+00:00 [None]>
[2024-07-24T21:14:03.041+0000] {taskinstance.py:2778} INFO - 1 downstream tasks scheduled from follow-on schedule check
What you think should happen instead
There should be a successful emit in the logs that says OpenLineageClient will emit event b...
How to reproduce
create openlineage.yml with the yaml file listed. Then create an http transport, and then reference a custom http transport from the openlineage.yml
Operating System
macOS Sonoma 14.5. Apple M1 Pro 2021
Versions of Apache Airflow Providers
2.7.2
Deployment
N/A
Deployment details
N/A
Anything Else
N/A
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (7 by maintainers)
Hey,
could you please point me to the place in the documentation that made you use
moduleandclassNamein youropenlineage.yml? Maybe the docs about custom transport could use some refreshing, but if something like this is there, it’s misleading 😄Please try providing the full path to your custom transport class under
typekey, so something like:this should be a full import path to your custom class that is subclass of Transport class.