Skip to content

Commit

Permalink
extra logs
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Jan 30, 2025
1 parent 69426fb commit d8b7f1a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class TestVisDynamicInstrumentation {
const onHit = this.onHitBreakpointByProbeId.get(probeId)
if (onHit) {
onHit({ snapshot })
} else {
log.warn('Received a breakpoint hit for an unknown probe')
}
}).unref()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,19 @@ async function addBreakpoint (probe) {
}
}

const { breakpointId } = await session.post('Debugger.setBreakpoint', {
location: {
scriptId,
lineNumber: lineNumber - 1
}
})
try {
const { breakpointId } = await session.post('Debugger.setBreakpoint', {
location: {
scriptId,
lineNumber: lineNumber - 1
}
})

breakpointIdToProbe.set(breakpointId, probe)
probeIdToBreakpointId.set(probe.id, breakpointId)
breakpointIdToProbe.set(breakpointId, probe)
probeIdToBreakpointId.set(probe.id, breakpointId)
} catch (e) {
log.error(`Error setting breakpoint at ${path}:${line}:`, e)
}
}

function start () {
Expand Down
1 change: 1 addition & 0 deletions packages/dd-trace/src/plugins/ci_plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ module.exports = class CiPlugin extends Plugin {
log.warn('Could not add breakpoint for dynamic instrumentation')
return
}
log.debug('Adding breakpoint for Dynamic Instrumentation')

const [probeId, setProbePromise] = this.di.addLineProbe({ file, line }, this.onDiBreakpointHit.bind(this))

Expand Down

0 comments on commit d8b7f1a

Please sign in to comment.