Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DataDog/dd-trace-py
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7c4ca59715e03452b6c519eddfc3d7d6866fab6b
Choose a base ref
..
head repository: DataDog/dd-trace-py
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a79386220a4a035773abb025587c3387f143299b
Choose a head ref
Showing with 21 additions and 11 deletions.
  1. +20 −10 ddtrace/debugging/_products/dynamic_instrumentation.py
  2. +1 −1 ddtrace/internal/remoteconfig/products/apm_tracing.py
30 changes: 20 additions & 10 deletions ddtrace/debugging/_products/dynamic_instrumentation.py
Original file line number Diff line number Diff line change
@@ -14,11 +14,15 @@ def post_preload():
Debugger.__watchdog__.install()


def _start():
from ddtrace.debugging import DynamicInstrumentation

DynamicInstrumentation.enable()


def start():
if config.enabled:
from ddtrace.debugging import DynamicInstrumentation

DynamicInstrumentation.enable()
_start()


def restart(join=False):
@@ -37,13 +41,19 @@ def at_exit(join=False):
stop(join=join)


def apm_tracing_rc(config):
enabled = config.get("dynamic_instrumentation_enabled")
if enabled is not None: # and config.spec.enabled.full_name not in config.source:
if (config.spec.enabled.full_name not in config.source or config.enabled) and enabled:
start()
else:
stop()
def apm_tracing_rc(lib_config):
enabled = lib_config.get("dynamic_instrumentation_enabled")
try:
if enabled is not None: # and config.spec.enabled.full_name not in config.source:
if (config.spec.enabled.full_name not in config.source or config.enabled) and enabled:
_start()
else:
stop()
except Exception:
from traceback import print_exc

print_exc()
raise


on("apm-tracing.rc", apm_tracing_rc, "dynamic-instrumentation")
2 changes: 1 addition & 1 deletion ddtrace/internal/remoteconfig/products/apm_tracing.py
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ def start():
from ddtrace.internal.remoteconfig.worker import remoteconfig_poller
from ddtrace.settings.remoteconfig import APMTracingAdapter

remoteconfig_poller.register("APM_TRACING", APMTracingAdapter())
remoteconfig_poller.register("APM_TRACING", APMTracingAdapter(), restart_on_fork=True)


def restart(join=False):