Skip to content

Instantly share code, notes, and snippets.

@dkuebric
Created January 20, 2012 22:21
Show Gist options
  • Save dkuebric/1649955 to your computer and use it in GitHub Desktop.
Save dkuebric/1649955 to your computer and use it in GitHub Desktop.
tracing arbitrary process
# init trace
evt = oboe.Context.startTrace()
evt.addInfo('Layer', func.__module__)
evt.addInfo('Label', 'entry')
evt.addInfo('HTTP-Host', socket.gethostname())
evt.addInfo('URL', '/%s/%s' % (func.__module__.replace('.', '/'), func.__name__))
evt.addInfo('Layer-Type', 'lang')
oboe.reporter().sendReport(evt)
try:
# traceable events will now report because oboe.Context is set
except Exception, e:
oboe.Context.log_error(exception=e)
raise
finally:
# end trace
oboe.Context.log(func.__module__, 'exit')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment