Created
January 20, 2012 22:21
-
-
Save dkuebric/1649955 to your computer and use it in GitHub Desktop.
tracing arbitrary process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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