newrelic-python-agent icon indicating copy to clipboard operation
newrelic-python-agent copied to clipboard

Add celery args as custom attributes

Open daveisfera opened this issue 4 years ago • 25 comments
trafficstars

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

daveisfera avatar May 13 '21 17:05 daveisfera

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.

stale[bot] avatar Jul 12 '21 17:07 stale[bot]

This is still an outstanding request and would love to have it considered for an addition in a future release

daveisfera avatar Jul 12 '21 17:07 daveisfera

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.

stale[bot] avatar Sep 10 '21 23:09 stale[bot]

This is still an outstanding request and would love to have it considered for an addition in a future release

daveisfera avatar Sep 10 '21 23:09 daveisfera

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.

stale[bot] avatar Nov 10 '21 21:11 stale[bot]

This is still an outstanding request and would love to have it considered for an addition in a future release

daveisfera avatar Nov 10 '21 22:11 daveisfera

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.

stale[bot] avatar Jan 10 '22 08:01 stale[bot]

This is still an outstanding request and would love to have it considered for an addition in a future release

daveisfera avatar Jan 10 '22 14:01 daveisfera

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.

stale[bot] avatar Mar 12 '22 12:03 stale[bot]

This is still an outstanding request that should be a relatively minor change with a big benefit

daveisfera avatar Mar 12 '22 17:03 daveisfera

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.

stale[bot] avatar Jun 13 '22 00:06 stale[bot]

This is still an outstanding request that should be a relatively minor change with a big benefit

daveisfera avatar Jun 13 '22 04:06 daveisfera

We want this as well. I'll have to implement this myself for now.

aleksanb avatar Jul 26 '22 16:07 aleksanb

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.

stale[bot] avatar Oct 01 '22 00:10 stale[bot]

This is still an outstanding request that should be a relatively minor change with a big benefit

daveisfera avatar Oct 01 '22 03:10 daveisfera

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)

aleksanb avatar Oct 03 '22 08:10 aleksanb

Thank you for the request, we have provided this issue to our product team for visibility and prioritization.

Ak-x avatar Oct 07 '22 17:10 Ak-x