Skip to content

Commit

Permalink
Remove build_tracer instrumentation again
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPansino committed May 3, 2024
1 parent f098385 commit d6bbcfd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
15 changes: 0 additions & 15 deletions newrelic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4372,21 +4372,6 @@ def _process_module_builtin_defaults():
"newrelic.hooks.application_celery",
"instrument_celery_app_base",
)
_process_module_definition(
"celery.app.trace",
"newrelic.hooks.application_celery",
"instrument_celery_execute_trace",
)
_process_module_definition(
"celery.execute.trace",
"newrelic.hooks.application_celery",
"instrument_celery_execute_trace",
)
_process_module_definition(
"celery.task.trace",
"newrelic.hooks.application_celery",
"instrument_celery_execute_trace",
)
_process_module_definition("billiard.pool", "newrelic.hooks.application_celery", "instrument_billiard_pool")

_process_module_definition("flup.server.cgi", "newrelic.hooks.adapter_flup", "instrument_flup_server_cgi")
Expand Down
20 changes: 0 additions & 20 deletions newrelic/hooks/application_celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,26 +234,6 @@ def instrument_celery_app_base(module):
wrap_function_wrapper(module, "Celery.send_task", wrap_Celery_send_task)


def instrument_celery_execute_trace(module):
if hasattr(module, "build_tracer"):

_build_tracer = module.build_tracer

def build_tracer(name, task, *args, **kwargs):
try:
task = task or module.tasks[name]

task_cls = type(task)
if not isinstance(task_cls.__call__, _NRBoundFunctionWrapper):
task_cls.__call__ = CeleryTaskWrapper(task_cls.__call__, name, source=task.__wrapped__)
except Exception:
pass

return _build_tracer(name, task, *args, **kwargs)

module.build_tracer = build_tracer


def instrument_celery_worker(module):
# Triggered for 'celery.worker' and 'celery.concurrency.processes'.

Expand Down

0 comments on commit d6bbcfd

Please sign in to comment.