dd-trace-py icon indicating copy to clipboard operation
dd-trace-py copied to clipboard

[BUG]: Celery "on_error" Task not showing in DataDog Metrics

Open clicktravel-antonrand opened this issue 5 months ago • 0 comments

Tracer Version(s)

2.7.0

Python Version(s)

Python 3.11.12

Pip Version(s)

pip 24.0

Bug Report

Hello,

Given the Reproduction code, I would expect to see a DataDog metric for the on_booking_error Celery task which is ran inside a parent task.

I don't see any metrics for this task though, despite seeing logs in DataDog showing it has ran (though I see metrics for the parent task).

Should DD Trace send metrics for the on_error callback task or do I need to do it manually?

Reproduction Code

tasks = [
    book_item.signature(
        args=[],
        immutable=True,
    )
    for item in booking_items
]

booking_finished_callback = on_booking_finished.s()

all_booking_tasks = chord(tasks)

res = all_booking_tasks(
    booking_finished_callback.on_error(on_booking_error.s())
)

Error Logs

No response

Libraries in Use

celery==5.3.6

Operating System

No response

clicktravel-antonrand avatar Jun 26 '25 16:06 clicktravel-antonrand