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
Copy file name to clipboardExpand all lines: docs/changelog.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,14 @@ hide:
5
5
6
6
# Changelog
7
7
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).
Copy file name to clipboardExpand all lines: docs/python-celery.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -177,3 +177,53 @@ def my_task(self, items):
177
177
This could indicate that the Task Badger API has not been [configured](python.md#configure), there was an error
178
178
creating the task, or the task is being run synchronously e.g. via `.apply()` or calling the task
179
179
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
+
defadd(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:
0 commit comments