Feature: Extend OpenLineage Connector to support Kafka topics as Pipeline inputs/outputs
Is your feature request related to a problem? Please describe.
The OpenLineage connector in OpenMetadata is currently designed exclusively for Pipelines with Database Tables as inputs/outpus. See https://github.com/open-metadata/OpenMetadata/blob/1.6.2-release/ingestion/src/metadata/ingestion/source/pipeline/openlineage/metadata.py#L66
OpenLineage is not limited to Database Tables, e.g. the spark integration can produce events with information about kafka topics as inputs/outputs.
Describe the solution you'd like
This feature request proposes enhancing the OpenMetadata OpenLineage connector to capture metadata for Kafka topics. This enhancement will allow orgs using Apache Kafka as part of their data pipelines to integrate topic-level metadata into the OpenMetadata platform through the OpenLineage framework.
Describe alternatives you've considered
none
Additional context
Steps to produce OpenLineage events with kafka as input source
Environment
Spark: 3.5.2 OpenLineage: 1.25.0 Iceberg: 1.6.1
OpenLineage Spark Config (pyspark code snippet)
Please not that this spark config code is not executable as is. It is rather a close enough pseude code on how to configure the openlineage integration in a spark job that produces events with the expected format.
.config("spark.extraListeners", "io.openlineage.spark.agent.OpenLineageSparkListener")
.config('spark.openlineage.namespace', 'mynamespace')
.config('spark.openlineage.transport.type', 'kafka')
.config('spark.openlineage.transport.topicName', 'openlineage.events')
.config('spark.openlineage.transport.properties.bootstrap.servers', 'https://<redacted>:9094')
.config('spark.openlineage.transport.properties.acks', 'all')
.config('spark.openlineage.transport.properties.retries', '3')
.config('spark.openlineage.transport.properties.key.serializer', 'org.apache.kafka.common.serialization.StringSerializer')
.config('spark.openlineage.transport.properties.value.serializer', 'org.apache.kafka.common.serialization.StringSerializer')
Spark Job code
Please not that this job code is not runnable as is. It is rather a close enough pseude code on how to write a spark job that produces events with the expected format.
spark
.read
.format("kafka")
.option("kafka.bootstrap.servers", "https://<redacted>:9094")
.option("subscribe", "test-topic")
.load()
.writeTo("test_table")
.create()
Please refer to example_message.json in pseudo JSON format with the kafka topic as input.
i think i had pretty much the same issue! i think openmetadata now dosent support the format inputs outputs by Openlienage.
I tested it in two ways: 1-Sending OpenLineage events directly from Airflow. 2-Sending OpenLineage events into Kafka topics
A few observations: OpenMetadata doesn’t support the POST /api/v1/lineage endpoint that OpenLineage expects. I successfully retrieved the inputs and outputs from the Kafka messages, but no lineage showed up in OpenMetadata. Even when extracting inlets and outlets directly from the Kafka messages, the lineage still didn’t appear.
So it looks like OpenMetadata isn’t compatible with OpenLineage’s message format at this point.
cc: @ulixius9 This issue is currently a blocker for us as well. I'm happy to look into it and raise a pull request to help resolve it. Please feel free to assign the issue to me if that works for you.
There is another similar comment from @orthoxerox in another issue which talks about the same thing: https://github.com/open-metadata/OpenMetadata/issues/22013#issuecomment-3015297095
@jsingh-yelp thanks for taking this up
Here is the PR: https://github.com/open-metadata/OpenMetadata/pull/25054 @harshach can I please have some one review it thanks.