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 6027976d6dc..fa0c89cdd7f 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