Skip to main content

Kafka Connect

Integration Details

This plugin extracts the following:

  • Source and Sink Connectors in Kafka Connect as Data Pipelines
  • For Source connectors - Data Jobs to represent lineage information between source dataset to Kafka topic per {connector_name}:{source_dataset} combination
  • For Sink connectors - Data Jobs to represent lineage information between Kafka topic to destination dataset per {connector_name}:{topic} combination

Concept Mapping

This ingestion source maps the following Source System Concepts to DataHub Concepts:

Source ConceptDataHub ConceptNotes
"kafka-connect"Data Platform
ConnectorDataFlow
Kafka TopicDataset

Current limitations

Works only for

  • Source connectors: JDBC, Debezium, Mongo and Generic connectors with user-defined lineage graph
  • Sink connectors: BigQuery

Module kafka-connect

Certified

Important Capabilities

CapabilityStatusNotes
Platform InstanceEnabled by default

CLI based Ingestion

Install the Plugin

pip install 'acryl-datahub[kafka-connect]'

Starter Recipe

Check out the following recipe to get started with ingestion! See below for full configuration options.

For general pointers on writing and running a recipe, see our main recipe guide.

source:
type: "kafka-connect"
config:
# Coordinates
connect_uri: "http://localhost:8083"

# Credentials
username: admin
password: password

# Optional
platform_instance_map:
bigquery: bigquery_platform_instance_id

sink:
# sink configs

Config Details

Note that a . is used to denote nested fields in the YAML recipe.

View All Configuration Options
FieldRequiredTypeDescriptionDefault
envstringThe environment that all assets produced by this connector belong toPROD
platform_instance_mapDict[str,string]Platform instance mapping to use when constructing URNs. e.g.platform_instance_map: { "hive": "warehouse" }
connect_uristringURI to connect to.http://localhost:8083/
usernamestringKafka Connect username.None
passwordstringKafka Connect password.None
cluster_namestringCluster to ingest from.connect-cluster
convert_lineage_urns_to_lowercasebooleanWhether to convert the urns of ingested lineage dataset to lowercaseFalse
provided_configsArray of objectProvided ConfigurationsNone
connect_to_platform_mapDictPlatform instance mapping when multiple instances for a platform is available. Entry for a platform should be in either platform_instance_map or connect_to_platform_map. e.g.connect_to_platform_map: { "postgres-connector-finance-db": "postgres": "core_finance_instance" }
generic_connectorsArray of objectProvide lineage graph for sources connectors other than Confluent JDBC Source Connector, Debezium Source Connector, and Mongo Source Connector[]
connector_patternsAllowDenyPattern (see below for fields)regex patterns for connectors to filter for ingestion.{'allow': ['.*'], 'deny': [], 'ignoreCase': True}
connector_patterns.allowArray of stringList of regex patterns to include in ingestion['.*']
connector_patterns.denyArray of stringList of regex patterns to exclude from ingestion.[]
connector_patterns.ignoreCasebooleanWhether to ignore case sensitivity during pattern matching.True

Advanced Configurations

Kafka Connect supports pluggable configuration providers which can load configuration data from external sources at runtime. These values are not available to DataHub ingestion source through Kafka Connect APIs. If you are using such provided configurations to specify connection url (database, etc) in Kafka Connect connector configuration then you will need also add these in provided_configs section in recipe for DataHub to generate correct lineage.

    # Optional mapping of provider configurations if using
provided_configs:
- provider: env
path_key: MYSQL_CONNECTION_URL
value: jdbc:mysql://test_mysql:3306/librarydb

Code Coordinates

  • Class Name: datahub.ingestion.source.kafka_connect.KafkaConnectSource
  • Browse on GitHub

Questions

If you've got any questions on configuring ingestion for Kafka Connect, feel free to ping us on our Slack