Skip to content

Conversation

@mitchellhenke
Copy link
Contributor

@mitchellhenke mitchellhenke commented Aug 6, 2018

This PR will bundle significant changes, including:

  • Switching from Poison to Jason for JSON operations
  • Removal of the Sentry.Logger :error_logger backend in favor of Sentry.LoggerBackend which leverages the new changes in Elixir 1.7 and OTP 21

defp encode_and_send(event, result) do
render_event(event)
|> Poison.encode()
|> Jason.encode()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets make this configurable a-la ecto/phoenix. "json_library"

Copy link
Contributor Author

@mitchellhenke mitchellhenke Aug 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would take some more thought as it complicates the installation. If an app adds Sentry, and :jason is the default (but still an optional dep), and they don't have Jason as a dependency or another library configured, it'll break Sentry. Phoenix solves this with the generation of a project and including a default dependency in mix.exs.

We'd have to do something like: https://github.com/phoenixframework/phoenix/blob/18871c898fee3a91034cd23a4b86444449daa991/lib/phoenix.ex#L79-L90 as well

It also seems semi-scary that we can't enforce that the JSON library implements a protocol or interface we expect? I don't see how Ecto/Phoenix catch that a bad configuration like :sentry, json_library: :ranch wouldn't work, and you don't find out until runtime?

I dunno how I feel for cost/benefit on it.

Created #303 to track this

@mitchellhenke mitchellhenke force-pushed the 1.7 branch 4 times, most recently from 5286bbe to 92eb3bb Compare September 5, 2018 19:44
@mitchellhenke mitchellhenke merged commit cbdad3f into master Sep 7, 2018
@mitchellhenke mitchellhenke deleted the 1.7 branch September 7, 2018 18:12
@mitchellhenke mitchellhenke changed the title [WIP] Elixir 1.7/OTP 21 Elixir 1.7/OTP 21 Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants