Skip to content
20 changes: 12 additions & 8 deletions ddtrace/debugging/_debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,19 +443,23 @@ def _probe_injection_hook(self, module):
failed = self._function_store.inject_hooks(
function, [(self._dd_debugger_hook, cast(LineProbe, probe).line, probe) for probe in probes]
)

for probe in probes:
if probe.probe_id in failed:
self._probe_registry.set_error(probe, "Failed to inject")
log.error("[%s][P: %s] Failed to inject %r", os.getpid(), os.getppid(), probe)
else:
self._probe_registry.set_installed(probe)
log.debug(
"[%s][P: %s] Injected probes %r in %r",
os.getpid(),
os.getppid(),
[probe.probe_id for probe in probes],
function,
)

if failed:
log.error("[%s][P: %s] Failed to inject probes %r", os.getpid(), os.getppid(), failed)

log.debug(
"[%s][P: %s] Injected probes %r in %r",
os.getpid(),
os.getppid(),
[probe.probe_id for probe in probes if probe.probe_id not in failed],
function,
)

def _inject_probes(self, probes):
# type: (List[LineProbe]) -> None
Expand Down