diff --git a/newrelic/hooks/application_celery.py b/newrelic/hooks/application_celery.py index a7d4fa613..da4fa78a6 100644 --- a/newrelic/hooks/application_celery.py +++ b/newrelic/hooks/application_celery.py @@ -105,7 +105,8 @@ def _application(): # Headers on earlier versions of Celery may end up as attributes # on the request context instead of as custom headers. Handler this # by defaulting to using vars() if headers is not available - headers = getattr(wrapped.request, "headers", None) or vars(wrapped.request) + request = instance.request + headers = getattr(request, "headers", None) or vars(request) settings = transaction.settings if headers is not None and settings is not None: