Skip to content

Commit

Permalink
Update agent.instrumentation.python.deep.py
Browse files Browse the repository at this point in the history
  • Loading branch information
plengauer authored Jan 7, 2025
1 parent 3b3a9fa commit 76414ce
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ def inject_file(file):
return '/bin/sh'

def inject_arguments(file, args):
return [ args[0], '-x', '-c', '. otel.sh\n' + file + ' "$@"', 'python' ] + args[1:]
return [ args[0], '-c', '. otel.sh\n' + file + ' "$@"', 'python' ] + args[1:]

def observed_os_execv(original_os_execve, file, args):
print('os.execv', file=sys.stderr)
print('os.execv(' + inject_file(file) + ', [' + ','.join(inject_args(args)) + '], ' + str(inject_env(None)) + ')', file=sys.stderr)
return original_os_execve(inject_file(file), inject_arguments(file, args), inject_env(None))

def observed_os_execve(original_os_execve, file, args, env):
print('os.execve', file=sys.stderr)
print('os.execve(' + inject_file(file) + ', [' + ','.join(inject_args(args)) + '], ' + str(inject_env(None)) + ')', file=sys.stderr)
return original_os_execve(inject_file(file), inject_arguments(file, args), inject_env(env))

# def observed_os_execvp(original_os_execvpe, file, args):
Expand Down

0 comments on commit 76414ce

Please sign in to comment.