Add new task argument to store metadata #705
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wrote integration for sentry, and want to add tracing between scheduling and task execution events. To do this, I need to pass
trace_id
(generated by sentry-sdk) between them.The integration wraps some methods transparently for users, so I can put
trace_id
into args or kwargs.But it's definitely a bad idea for this purpose.
It will be work fine as long as sentry-sdk is enabled, however a user can disable sentry-sdk between scheduling and task execution. Then kwargs will be contain the unwanted param, which can cause errors.
So I want to add the
meta
param into theTask
andMessage
classes, which will be used to any metadata of a task at runtime.