You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extra metrics are being sent to DataDog when using Allow list with pattern matching enabled #39400
with AIRFLOW__METRICS__METRICS_USE_PATTERN_MATCH set to true and AIRFLOW__METRICS__METRICS_ALLOW_LIST set to .*get_astronauts.* , I notice several other metrics being sent to datadog that don't match the pattern:
What you think should happen instead?
Following metrics shouldn't be showing up on datadog when the allow list is .*get_astronauts.*:
airflow.dag.task.duration.*
airflow.ti.*
datadog.* (Not sure if we have any control to block these)
How to reproduce
env variables:
AIRFLOW__METRICS__STATSD_DATADOG_ENABLED
true
AIRFLOW__METRICS__STATSD_DATADOG_TAGS
testNo:C2
DATADOG_API_KEY
● ● ● ● ● ● ●
AIRFLOW__METRICS__METRICS_USE_PATTERN_MATCH
true
AIRFLOW__METRICS__METRICS_ALLOW_LIST
.*print_astronaut_craft.*
Once you update your datadog key here, you will start seeing metrics in datadog-->metrics-->summary . use the tag testNo:C2 to filter
@eladkal , Yes. i just tested this and I can still replicate it. I added a allow list and yet, I see airflow.dag.task.duration.*, airflow.ti.* and others. in the screenshot, the results are when I added a tag "name:aftest" and allow list to be .*fail_zombie.*
This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.
I had a look at this on main and I don't think it's still valid.
metrics_use_pattern_match was removed in Airflow 3 — pattern matching is the only
mode now, so the config in the repro doesn't exist anymore. And the allow list itself
is applied on every emit path in the Datadog logger (incr, decr, gauge, timing, timer),
including for legacy metric names, so nothing is slipping past the filter.
What was really happening is that ti.start, ti.finish and task.duration don't have
the dag_id in the metric name — it's in the tags. So a pattern like .*get_astronauts.* was never going to match them. It only matches the legacy names
(dag.{dag_id}.{task_id}.duration and friends), which are behind legacy_names_on. The datadog.* ones are the DogStatsd client's own telemetry and were always outside our
allow list.
So this isn't a filtering bug — it's that allow/block lists match on names and aren't
tag-aware. That's a reasonable thing to want, but it's a different change from what's
described here, so I'd rather see it as its own feature request. Closing this one.
Drafted-by: Claude Code (Opus 5); reviewed by @hussein-awala before posting
Activity
eladkal commentedon Mar 3, 2025
@rawwar is this still an issue on main?
rawwar commentedon Mar 6, 2025
I'll try to replicate it later this week and reconfirm.
rawwar commentedon Mar 8, 2025
@eladkal , Yes. i just tested this and I can still replicate it. I added a allow list and yet, I see
airflow.dag.task.duration.*,airflow.ti.*and others. in the screenshot, the results are when I added a tag "name:aftest" and allow list to be.*fail_zombie.*rawwar commentedon Mar 8, 2025
However, I've unassigned myself as I won't be able to work on it at this time.
github-actions commentedon Sep 14, 2026
This issue has been automatically marked as stale because it has been open for 365 days without any activity. There has been several Airflow releases since last activity on this issue. Kindly asking to recheck the report against latest Airflow version and let us know if the issue is reproducible. The issue will be closed in next 30 days if no further activity occurs from the issue author.
eladkal commentedon Sep 14, 2026
cc @hussein-awala maybe someone from datadog has the time to pick it up?
hussein-awala commentedon Sep 15, 2026
I had a look at this on main and I don't think it's still valid.
metrics_use_pattern_matchwas removed in Airflow 3 — pattern matching is the onlymode now, so the config in the repro doesn't exist anymore. And the allow list itself
is applied on every emit path in the Datadog logger (incr, decr, gauge, timing, timer),
including for legacy metric names, so nothing is slipping past the filter.
What was really happening is that
ti.start,ti.finishandtask.durationdon't havethe dag_id in the metric name — it's in the tags. So a pattern like
.*get_astronauts.*was never going to match them. It only matches the legacy names(
dag.{dag_id}.{task_id}.durationand friends), which are behindlegacy_names_on. Thedatadog.*ones are the DogStatsd client's own telemetry and were always outside ourallow list.
So this isn't a filtering bug — it's that allow/block lists match on names and aren't
tag-aware. That's a reasonable thing to want, but it's a different change from what's
described here, so I'd rather see it as its own feature request. Closing this one.
Drafted-by: Claude Code (Opus 5); reviewed by @hussein-awala before posting