Git Product home page Git Product logo

rollbar-haskell's Introduction

Rollbar Haskell

All Contributors

CI Hackage Version Hackage Version Hackage Version Hackage Version

A group of libraries written in Haskell to communicate with Rollbar API. Inspired by bugsnag-haskell.

Requirements

  • Install one of the following set of tools (or all of them):
  • Set up a Rollbar account, create a project, and generate an access token.
    • To get an access token, go to your project's Settings and then to Project Access Tokens, where you can copy or create an access token with scope post_server_item.

Getting Started

Cabal

Compile the projects:

cabal update
cabal configure --enable-tests
cabal build all

Run all tests:

env ROLLBAR_TOKEN=<token> cabal test all

Stack

Compile the projects:

stack build

Run all tests:

env ROLLBAR_TOKEN=<token> stack test

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Sebastián Estrella
Sebastián Estrella

💻
William R. Arellano
William R. Arellano

💻
Juan Pedro Villa Isaza
Juan Pedro Villa Isaza

💻 💡
David Mazarro
David Mazarro

💻 🚧
Sebastian Avalos
Sebastian Avalos

💻
psilospore
psilospore

💻
Isaac Snow
Isaac Snow

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT, see the LICENSE file.

Contributing

Do you want to contribute to this project? Please take a look at our contributing guideline to know how you can help us build it.


Stack Builders Check out our libraries | Join our team

rollbar-haskell's People

Contributors

cptrodolfox avatar davidmazarro avatar dependabot[bot] avatar ijsnow avatar jpvillaisaza avatar psilospore avatar sebas1208 avatar sestrella avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rollbar-haskell's Issues

createItem not serializing `Nothing`s correctly

We are using katip for logging. So we want to create a Rollbar.Item from a Katip.Item and we have this function

mkRollbarItem :: Katip.LogItem a => Katip.Item a -> Rollbar.Item
mkRollbarItem katipItem =
  let payload =
        Rollbar.PayloadMessage $
          Rollbar.Message
            { Rollbar.messageBody =
                LT.toStrict . TB.toLazyText . coerce $
                  Katip._itemMessage katipItem
            , Rollbar.messageMetadata = katipItemToObject katipItem
            }
   in
      Rollbar.Item
        { Rollbar.itemEnvironment = Rollbar.Environment "production"
        , Rollbar.itemBody = Rollbar.Body payload
        , Rollbar.itemLevel =
            katipSeverityToRollbarLevel $
              Katip._itemSeverity katipItem
        , Rollbar.itemPlatform = Nothing
        , Rollbar.itemLanguage = Just "Haskell"
        , Rollbar.itemFramework = Nothing
        , Rollbar.itemRequest = Nothing
        , Rollbar.itemServer = Nothing
        , Rollbar.itemNotifier = Rollbar.Notifier "" ""
        }

Note that both Rollbar.itemServer and Rollbar.itemPlatform are listed as Maybes in the Rollbar.Client docs. And yet, we get this error. The ellipsis is irrelevant stuff

(StatusCodeException (Response {responseStatus = Status {statusCode = 422, statusMessage = "Unprocessable Entity"}, ... "{\n \"err\": 1,\n \"message\": \"Invalid format. data.platform should be string. data.server should be object.\"\n}")))

So we did

let rollbarItem = mkRollbarItem katipItem
_ <- Debug.trace (LBS.unpack $ Aeson.encode rollbarItem) (Rollbar.createItem rollbarItem)

and noticed that platform, server, and other Nothings were serialized as {"server":null, "platform":null, ...}, which seems to make rollbar api unhappy.

Add GHC 9 version to CI matrix

To support more actively GHC 9 for this library (which currently builds without issue up to GHC version 9.2.7), we want to include some GHC 9 version in the CI matrix within the GitHub Actions workflow.

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.