Giter Site home page Giter Site logo

exsentry's Introduction

ExSentry

wercker status Hex.pm Version Coverage Status

An Elixir client library for the Sentry error reporting platform.

Full ExSentry documentation is available on Hexdocs.pm.

Not an officially supported Sentry client.

Offered without guarantee, YMMV, etc.

Installation

  1. Add exsentry to your list of dependencies in mix.exs:

     def deps do
       [{:exsentry, "~> 0.2.0"}]
     end
    
  2. If using as an OTP application, ensure exsentry is started before your application in mix.exs:

     def application do
       [applications: [:exsentry]]
     end
    

    And configure your Sentry DSN in config.exs:

     config :exsentry, dsn: "your-dsn-here"
    

Usage

ExSentry can be used as a standalone client, as an OTP application tied into your app's lifecycle, or as a Plug in your webapp's plug stack (e.g., Phoenix router).

Standalone

Create a client process like this:

client = ExSentry.new("your-dsn-here")

And capture messages or exceptions like this:

client |> ExSentry.capture_message("Hello world!")

client |> ExSentry.capture_exception(an_exception)

client |> ExSentry.capture_exceptions fn ->
  something_that_might_raise()
end

OTP Application

If you've configured mix.exs and config.exs as described in installation step 2 above, you can invoke ExSentry without explicitly creating a client:

ExSentry.capture_message("Hello world!")

ExSentry.capture_exception(an_exception)

ExSentry.capture_exceptions fn ->
  something_that_might_raise()
end

Plug

ExSentry can be used as a Plug error handler, to automatically inform Sentry of any exceptions encountered within your web application.

To use ExSentry as a Plug error handler, follow the OTP configuration instructions, then put use ExSentry.Plug wherever your Plug stack is defined, for instance in web/router.ex in a Phoenix application:

defmodule MyApp.Router do
  use MyApp.Web, :router
  use ExSentry.Plug

  pipeline :browser do
  ...

Authorship and License

ExSentry is copyright 2015-2016 Appcues, Inc.

ExSentry is released under the MIT License, available at LICENSE.txt.

exsentry's People

Contributors

gamache avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.