Area: Ingestion Issues
Sub-Area: Airflow Plugin Configuration
Applies to: OSS + Cloud
Issue
You use acryl-datahub-airflow-plugin to send lineage from your Airflow DAGs to DataHub. You want to know whether the plugin limits how fast it calls the DataHub API, what happens when a call fails, and where you can see those failures.
This article describes the current plugin, which requires Airflow 3. DataHub no longer supports Airflow 2.x, and plugin fixes ship only for Airflow 3. See Compatibility.
You Might Be Asking
- Does the Airflow plugin have its own rate limiting?
- What happens if DataHub returns HTTP 429 or a 5xx error?
- Where do I find the plugin's logs when lineage doesn't show up?
- Does the plugin go through the DataHub Remote Executor?
- Why don't I see an error in Airflow when lineage is missing in DataHub?
Cause
The plugin runs inside your Airflow processes. It sends metadata straight to the DataHub server URL in your Airflow DataHub connection (datahub_rest_default by default). It does not go through the Remote Executor, so nothing about these calls shows up in Remote Executor logs.
The plugin has no rate limiter of its own. With a datahub-rest connection it uses the DataHub REST emitter, which retries failed requests:
- It retries on HTTP 429, 500, 502, 503 and 504, with exponential backoff (backoff factor 2).
- It makes up to 4 retries by default. On HTTP 429 it allows twice as many.
- When DataHub throttles writes, it answers with HTTP 429, and the emitter backs off and retries.
The plugin catches its own errors. A failed emission never fails your Airflow task. The plugin logs the error and moves on.
The plugin's default emit_mode is ASYNC. In this mode DataHub accepts the write and processes it later. If processing fails after DataHub accepted the write, the plugin never sees an error, so nothing appears in your Airflow logs.
Solution
1. Find the logs in the right place
Look in the Airflow task logs first. The plugin emits task lineage and run status from the task's own process, so the errors appear in the log of the task that produced the lineage. DAG run start events (the DataFlow for the DAG) come from the scheduler, so check the scheduler logs for those.
These messages mean an emission failed:
-
Error sending metadata to datahub:followed by the error -
Error in thread executingfollowed by the listener hook name, such ason_task_instance_success
The plugin runs its listener hooks in a background thread and waits up to 10 seconds for them. If a hook takes longer (for example, while the emitter retries), you see a warning that the thread is still running after the timeout, and the task continues.
2. Turn on the plugin's debug logging
Airflow's global [logging] logging_level is not the plugin setting. Use the plugin's own keys in the [datahub] section of airflow.cfg, described in Optional Configurations:
[datahub]
log_level = DEBUG
debug_emitter = True
log_level sets the level of the datahub_airflow_plugin logger. debug_emitter = True logs each event the plugin emits. Some setup problems, such as a connection the plugin can't use, are logged only at DEBUG level. Turn these settings back off once the integration works, because they make the logs much larger.
3. Make failed writes show up in Airflow
To get an error in the Airflow task log when DataHub rejects a write, switch from the default ASYNC mode to a synchronous mode:
[datahub]
emit_mode = SYNC_PRIMARY
With SYNC_PRIMARY (or SYNC_WAIT), DataHub returns the result of each write before the plugin moves on, so a rejected write raises an error that the plugin logs. Synchronous writes put more load on DataHub when you run many tasks, which is why ASYNC is the default.
4. Change the retry count if you need to
You don't need any rate limiting setting in the plugin. If you want more retries, use one of these:
- Add
{"retry_max_times": 6}(or another number) to the Extra field of yourdatahub-restAirflow connection. The plugin passes the connection's Extra values to the REST emitter. - Set the environment variable
DATAHUB_REST_EMITTER_DEFAULT_RETRY_MAX_TIMESin the Airflow worker and scheduler environments. The default is 4.
If you see repeated HTTP 429 responses on a self-hosted DataHub, review your server's throttling settings. On DataHub Cloud, contact DataHub Support.