Skip to content

Commit e6c26cf

Browse files
committed
update docs for v1.6.3
1 parent 2a53422 commit e6c26cf

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

docs/changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ hide:
55

66
# Changelog
77

8+
## v1.6.3
9+
10+
**2026-02-05**
11+
12+
**Python SDK**
13+
14+
* **NEW** Track Celery canvas primitives (`map`, `starmap`, `chunks`) so that inner tasks are recorded in Task Badger. More info in the [Celery docs](python-celery.md#canvas-primitives-map--starmap--chunks).
15+
816
## v1.6.2
917

1018
**2025-12-04**

docs/python-celery.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,3 +177,53 @@ def my_task(self, items):
177177
This could indicate that the Task Badger API has not been [configured](python.md#configure), there was an error
178178
creating the task, or the task is being run synchronously e.g. via `.apply()` or calling the task
179179
using `.map` or `.starmap`, `.chunk`.
180+
181+
## Canvas primitives (map / starmap / chunks)
182+
183+
As of `v1.6.3`, Task Badger now tracks tasks created via Celery canvas primitives: `map`, `starmap`, and `chunks`. Previously these were executed as built-in `celery.map` / `celery.starmap` tasks and were filtered out; TaskBadger now creates task records for the *inner* tasks produced by these primitives.
184+
185+
Behavior summary:
186+
187+
- Canvas primitives produce Task Badger tasks using the inner task's name (so the tracked task has the same name as if the task had been executed individually).
188+
- Each created task includes additional metadata:
189+
- `canvas_type`: one of `celery.map`, `celery.starmap`, or `celery.chunks`
190+
- `item_count`: number of inner items produced by the canvas execution (an integer)
191+
- `celery_task_items`: the arguments passed to the inner task
192+
193+
**Example**
194+
195+
Assume a Celery task:
196+
197+
```python
198+
@app.task(name="myapp.add")
199+
def add(x, y):
200+
return x + y
201+
```
202+
203+
Running a map:
204+
205+
```python
206+
# This schedules 3 inner tasks
207+
add.map([(1, 2), (2, 3), (3, 4)]).apply_async()
208+
```
209+
210+
Task Badger will create task records for each inner invocation with metadata similar to:
211+
212+
```json
213+
{
214+
"name": "myapp.add",
215+
"metadata": {
216+
"canvas_type": "celery.map",
217+
"item_count": 3,
218+
"celery_task_items": [[1, 2], [2, 3], [3, 4]]
219+
}
220+
}
221+
```
222+
223+
**Opting out**
224+
225+
If you want to prevent TaskBadger from tracking a particular execution, set the `taskbadger_track` header (False) when publishing:
226+
227+
```python
228+
add.map([(1, 2), (2, 3)]).apply_async(headers={"taskbadger_track": False})
229+
```

0 commit comments

Comments
 (0)