Hi, you can set the release on init
like this:
init(..., release="my git hash")
However, there is no equivalent to fetch_git_sha
in the new SDK! We felt that it did something quite unrelated to the SDK’s core function (fetch current HEAD of the git repo) and also a bit specific to how you deploy your code, so we didn’t port it.
You have a bunch of options right now:
- Copypaste the function from Raven into your own codebase: https://github.com/getsentry/raven-python/blob/d7d14f61b7fb425bcb15512f659626648c494f98/raven/versioning.py#L11
- Pick one of the solutions for fetching the current git commit hash from here: https://stackoverflow.com/questions/14989858/get-the-current-git-hash-in-a-python-script
- Figure out if your deployment tooling provides a way to get a current “version” of the application and use that.