Configuration
We recommend configuring the client with an openlineage.yml file that contains all the
details of how to connect to your OpenLineage backend.
You can make this file available to the client in three ways (the list also presents precedence of the configuration):
- Set an
OPENLINEAGE_CONFIGenvironment variable to a file path:OPENLINEAGE_CONFIG=path/to/openlineage.yml. - Place an
openlineage.ymlin the user's current working directory. - Place an
openlineage.ymlunder.openlineage/in the user's home directory (~/.openlineage/openlineage.yml).
Environment Variables
The following environment variables are available:
| Name | Description | Since |
|---|---|---|
| OPENLINEAGE_CONFIG | The path to the YAML configuration file. Example: path/to/openlineage.yml | |
| OPENLINEAGE_DISABLED | When true, OpenLineage will not emit events. | 0.9.0 |
You can also configure the client with dynamic environment variables.
The OpenLineage client supports configuration through dynamic environment variables.
Configuring OpenLineage Client via Dynamic Environment Variables
These environment variables must begin with OPENLINEAGE__, followed by sections of the configuration separated by a double underscore __.
All values in the environment variables are automatically converted to lowercase,
and variable names using snake_case (single underscore) are converted into camelCase within the final configuration.
Key Features
- Prefix Requirement: All environment variables must begin with
OPENLINEAGE__. - Sections Separation: Configuration sections are separated using double underscores
__to form the hierarchy. - Lowercase Conversion: Environment variable values are automatically converted to lowercase.
- CamelCase Conversion: Any environment variable name using single underscore
_will be converted to camelCase in the final configuration. - JSON String Support: You can pass a JSON string at any level of the configuration hierarchy, which will be merged into the final configuration structure.
- Hyphen Restriction: You cannot use
-in environment variable names. If a name strictly requires a hyphen, use a JSON string as the value of the environment variable. - Precedence Rules:
- Top-level keys have precedence and will not be overwritten by more nested entries.
- For example,
OPENLINEAGE__TRANSPORT='{..}'will not have its keys overwritten byOPENLINEAGE__TRANSPORT__AUTH__KEY='key'.
Examples
- Basic Example
- Composite Example
- Precedence Example
- Spark Example
- Namespace Resolvers Example
Setting following environment variables:
OPENLINEAGE__TRANSPORT__TYPE=http
OPENLINEAGE__TRANSPORT__URL=http://localhost:5050
OPENLINEAGE__TRANSPORT__ENDPOINT=/api/v1/lineage
OPENLINEAGE__TRANSPORT__AUTH__TYPE=api_key
OPENLINEAGE__TRANSPORT__AUTH__API_KEY=random_token
OPENLINEAGE__TRANSPORT__COMPRESSION=gzip
is equivalent to passing following YAML configuration:
transport:
type: http
url: http://localhost:5050
endpoint: api/v1/lineage
auth:
type: api_key
apiKey: random_token
compression: gzip
Setting following environment variables:
OPENLINEAGE__TRANSPORT__TYPE=composite
OPENLINEAGE__TRANSPORT__TRANSPORTS__FIRST__TYPE=http
OPENLINEAGE__TRANSPORT__TRANSPORTS__FIRST__URL=http://localhost:5050
OPENLINEAGE__TRANSPORT__TRANSPORTS__FIRST__ENDPOINT=/api/v1/lineage
OPENLINEAGE__TRANSPORT__TRANSPORTS__FIRST__AUTH__TYPE=api_key
OPENLINEAGE__TRANSPORT__TRANSPORTS__FIRST__AUTH__API_KEY=random_token
OPENLINEAGE__TRANSPORT__TRANSPORTS__FIRST__AUTH__COMPRESSION=gzip
OPENLINEAGE__TRANSPORT__TRANSPORTS__SECOND__TYPE=console
is equivalent to passing following YAML configuration:
transport:
type: composite
transports:
first:
type: http
url: http://localhost:5050
endpoint: api/v1/lineage
auth:
type: api_key
apiKey: random_token
compression: gzip
second:
type: console
Setting following environment variables:
OPENLINEAGE__TRANSPORT='{"type":"console"}'
OPENLINEAGE__TRANSPORT__TYPE=http
is equivalent to passing following YAML configuration:
transport:
type: console
Setting following environment variables:
OPENLINEAGE__TRANSPORT__TYPE=kafka
OPENLINEAGE__TRANSPORT__TOPIC_NAME=test
OPENLINEAGE__TRANSPORT__MESSAGE_KEY=explicit-key
OPENLINEAGE__TRANSPORT__PROPERTIES='{"key.serializer": "org.apache.kafka.common.serialization.StringSerializer"}'
is equivalent to passing following YAML configuration:
transport:
type: kafka
topicName: test
messageKey: explicit-key
properties:
key.serializer: org.apache.kafka.common.serialization.StringSerializer
Please note that you can't use environment variables to set Spark properties, as they are not part of the configuration hierarchy. Following environment variable:
OPENLINEAGE__TRANSPORT__PROPERTIES__KEY__SERIALIZER="org.apache.kafka.common.serialization.StringSerializer"
would be equivalent to below YAML structure:
transport:
properties:
key:
serializer: org.apache.kafka.common.serialization.StringSerializer
which is not a valid configuration for Spark.
Setting following environment variables:
OPENLINEAGE__DATASET__NAMESPACE_RESOLVERS__RESOLVED_NAME__TYPE=hostList
OPENLINEAGE__DATASET__NAMESPACE_RESOLVERS__RESOLVED_NAME__HOSTS='["kafka-prod13.company.com", "kafka-prod15.company.com"]'
OPENLINEAGE__DATASET__NAMESPACE_RESOLVERS__RESOLVED_NAME__SCHEMA=kafka
is equivalent to passing following YAML configuration:
dataset:
namespaceResolvers:
resolvedName:
type: hostList
hosts:
- kafka-prod13.company.com
- kafka-prod15.company.com
schema: kafka
Facets Configuration
In YAML configuration file you can also disable facets to filter them out from the OpenLineage event.
YAML Configuration
transport:
type: console
facets:
spark_unknown:
disabled: true
"spark.logicalPlan":
disabled: true
Deprecated and removed syntax
The following syntax was deprecated and got removed:
facets:
disabled:
- spark_unknown
- spark.logicalPlan
Please be aware that this syntax is not working anymore.