From 523635febeaeec33c813bc28840c5d4059502b16 Mon Sep 17 00:00:00 2001 From: Munir Abdinur Date: Thu, 19 Dec 2024 18:05:32 -0500 Subject: [PATCH] chore(tracing): move mini agent out of tracing --- ddtrace/__init__.py | 5 +++++ ddtrace/_trace/tracer.py | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ddtrace/__init__.py b/ddtrace/__init__.py index 1954c1961c9..1f2049cd0a5 100644 --- a/ddtrace/__init__.py +++ b/ddtrace/__init__.py @@ -33,6 +33,11 @@ from .version import get_version # noqa: E402 +# TODO(mabdinur): Remove this once we have a better way to start the mini agent +from ddtrace.internal.serverless.mini_agent import maybe_start_serverless_mini_agent as _start_mini_agent + +_start_mini_agent() + # DEV: Import deprecated tracer module in order to retain side-effect of package # initialization, which added this module to sys.modules. We catch deprecation # warnings as this is only to retain a side effect of the package diff --git a/ddtrace/_trace/tracer.py b/ddtrace/_trace/tracer.py index 8c82efbdf37..f972e9de317 100644 --- a/ddtrace/_trace/tracer.py +++ b/ddtrace/_trace/tracer.py @@ -53,7 +53,6 @@ from ddtrace.internal.serverless import in_aws_lambda from ddtrace.internal.serverless import in_azure_function from ddtrace.internal.serverless import in_gcp_function -from ddtrace.internal.serverless.mini_agent import maybe_start_serverless_mini_agent from ddtrace.internal.service import ServiceStatusError from ddtrace.internal.utils import _get_metas_to_propagate from ddtrace.internal.utils.deprecations import DDTraceDeprecationWarning @@ -211,8 +210,6 @@ def __init__( :param dogstatsd_url: The DogStatsD URL. """ - maybe_start_serverless_mini_agent() - self._filters: List[TraceFilter] = [] # globally set tags