Copyright | (c) 2020 Stack Builders Inc. |
---|---|
License | MIT |
Maintainer | Sebastián Estrella <sestrella@stackbuilders.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data Deploy = Deploy {}
- mkDeploy :: (HasSettings m, MonadIO m) => Revision -> m Deploy
- data Status
- newtype DeployId = DeployId Integer
- reportDeploy :: (HasSettings m, MonadHttp m) => Deploy -> m DeployId
- data Item = Item {}
- mkItem :: (HasSettings m, MonadIO m) => Payload -> m Item
- newtype Body = Body {}
- data Payload
- data Trace = Trace {
- traceFrames :: [Frame]
- traceException :: Exception
- data Frame = Frame {}
- data Context = Context {
- contextPre :: [Text]
- contextPost :: [Text]
- data Exception = Exception {}
- mkException :: Exception e => e -> Exception
- data Message = Message {}
- data Level
- mkLevel :: Payload -> Level
- data Request = Request {}
- getRequestModifier :: (HasSettings m, Monad m) => m (Request -> Request)
- data Server = Server {}
- data Notifier = Notifier {}
- defaultNotifier :: Notifier
- newtype ItemId = ItemId Text
- createItem :: (HasSettings m, MonadHttp m) => Item -> m ItemId
- data Pong = Pong
- ping :: MonadHttp m => m Pong
- class HasSettings m where
- getSettings :: m Settings
- data Settings = Settings {}
- readSettings :: MonadIO m => FilePath -> m Settings
- newtype Token = Token ByteString
- newtype Environment = Environment Text
- newtype Revision = Revision Text
- getRevision :: (HasSettings m, MonadIO m) => m Revision
- getRevisionMaybe :: (HasSettings m, MonadIO m) => m (Maybe Revision)
- data RequestModifiers = RequestModifiers {}
- defaultRequestModifiers :: RequestModifiers
- newtype Rollbar a = Rollbar (ReaderT Settings Req a)
- withRollbar :: (MonadCatch m, MonadIO m) => Settings -> m a -> m a
- runRollbar :: MonadIO m => Settings -> Rollbar a -> m a
Deploy
Requests
Deploy | |
|
Status of the deployment.
Responses
Endpoints
reportDeploy :: (HasSettings m, MonadHttp m) => Deploy -> m DeployId Source #
Tracks a deploy in Rollbar.
Example
settings <- readSettings "rollbar.yaml" runRollbar settings $ do deploy <- getRevision >>= mkDeploy reportDeploy deploy
Reference
Item
Requests
Item | |
|
The main data being sent. It can either be a message, an exception, or a crash report.
Trace | |
|
Frame | |
|
Additional code before and after the "code" line.
Context | |
|
An object describing the exception instance.
Exception | |
|
mkException :: Exception e => e -> Exception Source #
Builds a Exception
based on SomeException
.
The severity level. One of: "critical", "error", "warning", "info", "debug" Defaults to "error" for exceptions and "info" for messages. The level of the *first* occurrence of an item is used as the item's level.
Data about the request this event occurred in.
Request | |
|
getRequestModifier :: (HasSettings m, Monad m) => m (Request -> Request) Source #
Pulls RequestModifiers
out of Settings
and build a list of 'Endo
Request' which are folded as a single request modifier function.
Data about the server related to this event.
Server | |
|
defaultNotifier :: Notifier Source #
Returns information about this package such as the name and version.
Responses
Endpoints
createItem :: (HasSettings m, MonadHttp m) => Item -> m ItemId Source #
Reports an occurrence (exception or message) to Rollbar.
Example
settings <- readSettings "rollbar.yaml" runRollbar settings $ do item <- mkItem $ PayloadTrace $ Trace [] $ Exception { exceptionClass = "NameError" , exceptionMessage = Just "global name 'foo' is not defined" , exceptionDescription = Just "Something went wrong while trying to save the user object" } createItem item
Reference
Ping
Requests
Endpoints
ping :: MonadHttp m => m Pong Source #
Pings Rollbar API server, on success returns Pong
.
Example
settings <- readSettings "rollbar.yaml" runRollbar settings ping
Reference
Settings
class HasSettings m where Source #
getSettings :: m Settings Source #
Instances
HasSettings Rollbar Source # | |
Defined in Rollbar.Client |
General settings required to interact with Rollbar API.
Settings | |
|
newtype Environment Source #
Environment to which the revision was deployed.
Instances
FromJSON Environment Source # | |
Defined in Rollbar.Client.Settings parseJSON :: Value -> Parser Environment # parseJSONList :: Value -> Parser [Environment] # | |
ToJSON Environment Source # | |
Defined in Rollbar.Client.Settings toJSON :: Environment -> Value # toEncoding :: Environment -> Encoding # toJSONList :: [Environment] -> Value # toEncodingList :: [Environment] -> Encoding # | |
Show Environment Source # | |
Defined in Rollbar.Client.Settings showsPrec :: Int -> Environment -> ShowS # show :: Environment -> String # showList :: [Environment] -> ShowS # | |
Eq Environment Source # | |
Defined in Rollbar.Client.Settings (==) :: Environment -> Environment -> Bool # (/=) :: Environment -> Environment -> Bool # |
Git SHA of revision being deployed.
getRevision :: (HasSettings m, MonadIO m) => m Revision Source #
Similar to getRevisionMaybe
, but it throws a RevisionNotFound
if the
Revision
is not found.
getRevisionMaybe :: (HasSettings m, MonadIO m) => m (Maybe Revision) Source #
data RequestModifiers Source #
Represents a list of Request
modifiers that are combined by
getRequestModifier
into a single function.
RequestModifiers | |
|
Instances
FromJSON RequestModifiers Source # | |
Defined in Rollbar.Client.Settings parseJSON :: Value -> Parser RequestModifiers # parseJSONList :: Value -> Parser [RequestModifiers] # | |
Show RequestModifiers Source # | |
Defined in Rollbar.Client.Settings showsPrec :: Int -> RequestModifiers -> ShowS # show :: RequestModifiers -> String # showList :: [RequestModifiers] -> ShowS # | |
Eq RequestModifiers Source # | |
Defined in Rollbar.Client.Settings (==) :: RequestModifiers -> RequestModifiers -> Bool # (/=) :: RequestModifiers -> RequestModifiers -> Bool # |
defaultRequestModifiers :: RequestModifiers Source #
Returns an empty RequestModifiers
, the function produced by
getRequestModifier
given this values is equivalent to id
.
withRollbar :: (MonadCatch m, MonadIO m) => Settings -> m a -> m a Source #
Runs a computation, captures any SomeException
threw, and send it to
Rollbar.