Skip to content

Support a Unix Domain Socket for the Datadog metrics client - #70517

Draft
sortega wants to merge 3 commits into
apache:mainfrom
sortega:sortega/DNAWF-4497_dd_dogstats_url
Draft

Support a Unix Domain Socket for the Datadog metrics client#70517
sortega wants to merge 3 commits into
apache:mainfrom
sortega:sortega/DNAWF-4497_dd_dogstats_url

Conversation

@sortega

@sortega sortega commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds a [metrics] statsd_socket_path option so Airflow's Datadog StatsD client can submit metrics over a Unix Domain Socket instead of host/port.

Today get_dogstatsd_logger only passes statsd_host / statsd_port to DogStatsd, so deployments that expose DogStatsD over a UDS — e.g. the Datadog Kubernetes operator, which mounts a socket and sets DD_DOGSTATSD_URL=unix:///var/run/datadog/dsd.socket — have no way to use it from Airflow. datadog supports a socket path; this exposes it through Airflow config.

When statsd_socket_path is set it takes precedence over host/port (matching DogStatsd's own precedence), and the wrapper leaves host/port unset so the socket is used. The option is nullable and only affects the Datadog client (statsd_datadog_enabled = True); the plain StatsD is unchanged.

  • New nullable [metrics] statsd_socket_path config key.
  • get_dogstatsd_logger (shared) gains a socket_path kwarg passed through to DogStatsd.
  • airflow-core and task-sdk wrappers read the new key and omit host/port when it is set.
  • Unit test covering socket_path passthrough / host/port omission.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8 1M)

Generated-by: Claude Code (Opus 4.8 1M) following the guidelines

The Datadog StatsD logger could only be pointed at a host and port, so
deployments that expose DogStatsD over a Unix Domain Socket (for example the
Datadog Kubernetes operator, which mounts a socket and sets DD_DOGSTATSD_URL)
had no way to use it from Airflow.

Add a ``[metrics] statsd_socket_path`` option that is passed to the DogStatsd
client. When set it takes precedence over ``statsd_host`` / ``statsd_port``,
which are then left unset so the socket is used.
sortega added 2 commits July 27, 2026 12:34
The rst-backticks check requires double backticks for inline code in RST.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant