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()