Skip to content

Instantly share code, notes, and snippets.

@mitchellhenke
Last active April 20, 2017 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchellhenke/5248b3073f113309fa25550a0e4126d4 to your computer and use it in GitHub Desktop.
Save mitchellhenke/5248b3073f113309fa25550a0e4126d4 to your computer and use it in GitHub Desktop.
Sentry 3.0.0 to 4.0.0 Upgrade Instructions

Sentry 4.0.0

This release contains a significant number of changes, including some backwards incompatible ones.

Bump your sentry dependency

def deps do
  [{:sentry, "~> 4.0"},
   ...]
end

Then run mix deps.update sentry

Backwards Incompatible Changes

Displaying Source Code Responsible for Errors

Sentry supports displaying the source code that caused an error, and now the library now supports it.

Example:

Some extra configuration is now required because of this.

If you'd like to enable the feature, add the following to your config:

      config :sentry,
        enable_source_code_context: true,
        root_source_code_path: File.cwd!

If you'd like to disable it, add the following:

      config :sentry,
        enable_source_code_context: false

Due to the way the source code is handled for reporting, you have to force recompiling Sentry with mix deps.compile sentry --force before deploying to production to ensure the most recent source code is reported. For more information, please see the docs.

Automatically Ignoring Plug and Phoenix Invalid Route Errors

Starting in 4.0.0, Sentry.Plug will not report Phoenix.Router.NoRouteError as well as unmatched route errors in Plug.

Sentry.send_event, Sentry.capture_exception, and Sentry.capture_message Return Success/Error more accurately

Previously, the above methods would return Task on success, and potentially {:ok, String.t} on an error. They will now return {:ok, Task} if successful, :ignored if the Event is invalid or not in an active environment. If Sentry.capture_exception is configured to exclude a particular exception, it will continue to return :excluded.

Other Stuff

There were also a bunch of smaller improvements, which you can see in the changelog.

Special thank yous to @jeregrine, @hauleth, @colinrymer, @waj, @myronmarston, and @DavidAntaramian for contributing to this release.

If you run into any problems, please don't hesitate to open an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment