newrelic-python-agent
newrelic-python-agent copied to clipboard
Add celery args as custom attributes
Is your feature request related to a problem? Please describe.
Custom attributes are very useful, but having to manually set them for celery task is cumbersome
Feature Description
Automatically add scalar arguments from a celery task as custom attributes (assuming that a custom attribute that's non-scalar (like dict, list, set, etc) is problematic)
Describe Alternatives
Current option is to manually add them and this is a pain and easy to forget
Additional context
This would make the celery integration even more powerful than it already is and make a powerful feature from New Relic (i.e. custom attributes) instantly available to users out of the box.
Priority
Really Want
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an outstanding request and would love to have it considered for an addition in a future release
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an outstanding request and would love to have it considered for an addition in a future release
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an outstanding request and would love to have it considered for an addition in a future release
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an outstanding request and would love to have it considered for an addition in a future release
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an outstanding request that should be a relatively minor change with a big benefit
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an outstanding request that should be a relatively minor change with a big benefit
We want this as well. I'll have to implement this myself for now.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still an outstanding request that should be a relatively minor change with a big benefit
This is the solution we went with on our end, for future reference:
class CustomBaseTask(Task):
"""
Annotates the new relic trace with args and kwargs.
"""
def __call__(self, *args, **kwargs):
if newrelic.agent.current_transaction():
parameters = make_custom_parameters_from_celery_task(self.name, args, kwargs)
newrelic.agent.add_custom_parameters(parameters)
return super().__call__(*args, **kwargs)
Thank you for the request, we have provided this issue to our product team for visibility and prioritization.