Skip to content

Instantly share code, notes, and snippets.

@smartkiwi
Last active February 10, 2016 17:32
Show Gist options
  • Save smartkiwi/44888c01e6a73e993a40 to your computer and use it in GitHub Desktop.
Save smartkiwi/44888c01e6a73e993a40 to your computer and use it in GitHub Desktop.
Using sentry for debugging spark code running on executirs
from raven import Client
from raven.context import Context
# copy from your project
# in future can be passed with spark app options
dsn="https://SOMETHING@app.getsentry.com/34960"
environment="dev"
client = Client(dsn)
def some_mapper_function(e):
with Context(client, tags={"environment": environment}):
raise 1/0
return e
if __name__ == "__main__":
sc.parallelize(range(10)).map(some_mapper_function).collect()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment