From 48ed73badecae586538210b8ef8d64495c4b409c Mon Sep 17 00:00:00 2001 From: Owais Lone Date: Wed, 10 Nov 2021 05:53:53 +0530 Subject: [PATCH] Remove special support for celery from sitecustomize This is not required anymore after merging https://github.com/open-telemetry/opentelemetry-python/pull/2242 --- .../auto_instrumentation/sitecustomize.py | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py index 2a26fb1544..e97135053b 100644 --- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py +++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/auto_instrumentation/sitecustomize.py @@ -12,9 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys from logging import getLogger -from os import environ, path +from os import environ from os.path import abspath, dirname, pathsep from re import sub @@ -125,17 +124,4 @@ def initialize(): ) -if ( - hasattr(sys, "argv") - and sys.argv[0].split(path.sep)[-1] == "celery" - and "worker" in sys.argv[1:] -): - from celery.signals import worker_process_init # pylint:disable=E0401 - - @worker_process_init.connect(weak=False) - def init_celery(*args, **kwargs): - initialize() - - -else: - initialize() +initialize()