Skip to content

Commit 469e042

Browse files
committed
add docs for 'record_task_args'
1 parent b02b12b commit 469e042

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

docs/python-celery.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,18 @@ taskbadger.init(
2929
)
3030
```
3131

32-
To track only certain tasks, you can use the `includes` and `excludes` parameters which take a list of task names
33-
or patterns:
32+
### System Integration Options
3433

35-
```python
36-
CelerySystemIntegration(
37-
includes=[
38-
"myapp.tasks.*",
39-
"myapp.other_tasks.special_task"
40-
],
41-
excludes=[
42-
"myapp.tasks.heartbeat",
43-
]
44-
)
45-
```
34+
The `CelerySystemIntegration` class takes a number of optional parameters:
35+
36+
- `auto_track_tasks`: Set this to `False` to disable automatic tracking of tasks.
37+
- `includes`: A list of task names or patterns to include. If this is set, only tasks that match one of the patterns
38+
will be tracked.
39+
- `excludes`: A list of task names or patterns to exclude. If this is set, tasks that match one of the patterns will
40+
not be tracked.
41+
- `record_task_args`: If `True`, the arguments passed to the task will be recorded in the Task Badger task data.
42+
43+
==Since v1.4.0==
4644

4745
Exclusions take precedence over inclusions so if a task name matches both an include and an exclude, it will be
4846
excluded.
@@ -135,6 +133,16 @@ my_task.apply_async(arg1, arg2, taskbadger_kwargs={
135133
In both the decorator and `apply_async`, if individual keyword arguments are used as well as
136134
the `taskbadger_kwargs` dictionary, the individual arguments will take precedence.
137135

136+
137+
!!!note "Recording task args"
138+
139+
By default, the arguments passed to the task are not recorded in the Task Badger task data. To record the
140+
arguments, set the `taskbadger_record_task_args` parameter to `True` in the task decorator or in the `apply_async` call.
141+
This will override the value set in the `CelerySystemIntegration` if it is being used.
142+
143+
==Since v1.4.0==
144+
145+
138146
### Accessing the Task Object
139147

140148
The `taskbadger.celery.Task` class provides access to the Task Badger task object via the `taskbadger_task` property

mkdocs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ markdown_extensions:
2121
- tables
2222
- def_list
2323
- attr_list
24+
- pymdownx.caret
25+
- pymdownx.mark
26+
- pymdownx.tilde
2427
- pymdownx.highlight:
2528
anchor_linenums: true
2629
- pymdownx.inlinehilite

0 commit comments

Comments
 (0)