Last active
February 10, 2016 17:32
-
-
Save smartkiwi/44888c01e6a73e993a40 to your computer and use it in GitHub Desktop.
Using sentry for debugging spark code running on executirs
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
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