Copyright | (c) 2020 Stack Builders Inc. |
---|---|
License | MIT |
Maintainer | Sebastián Estrella <sestrella@stackbuilders.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Rollbar.Client
Description
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
Constructors
Deploy | |
Fields
|
Status of the deployment.
Constructors
StatusStarted | |
StatusSucceeded | |
StatusFailed | |
StatusTimedOut |
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
Constructors
Item | |
Fields
|
The main data being sent. It can either be a message, an exception, or a crash report.
Constructors
Body | |
Fields |
Constructors
PayloadTrace Trace | |
PayloadTraceChain [Trace] | |
PayloadMessage Message |
Constructors
Trace | |
Fields
|
Constructors
Frame | |
Fields
|
Additional code before and after the "code" line.
Constructors
Context | |
Fields
|
An object describing the exception instance.
Constructors
Exception | |
Fields
|
mkException :: Exception e => e -> Exception Source #
Builds a Exception
based on SomeException
.
Constructors
Message | |
Fields
|
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.
Constructors
LevelCritical | |
LevelError | |
LevelWarning | |
LevelInfo | |
LevelDebug |
Data about the request this event occurred in.
Constructors
Request | |
Fields
|
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.
Constructors
Server | |
Fields
|
Constructors
Notifier | |
Fields
|
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
Constructors
Pong |
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 #
Methods
getSettings :: m Settings Source #
Instances
HasSettings Rollbar Source # | |
Defined in Rollbar.Client Methods |
General settings required to interact with Rollbar API.
Constructors
Settings | |
Fields
|
Constructors
Token ByteString |
newtype Environment Source #
Environment to which the revision was deployed.
Constructors
Environment Text |
Instances
FromJSON Environment Source # | |
Defined in Rollbar.Client.Settings | |
ToJSON Environment Source # | |
Defined in Rollbar.Client.Settings Methods toJSON :: Environment -> Value # toEncoding :: Environment -> Encoding # toJSONList :: [Environment] -> Value # toEncodingList :: [Environment] -> Encoding # | |
Show Environment Source # | |
Defined in Rollbar.Client.Settings Methods showsPrec :: Int -> Environment -> ShowS # show :: Environment -> String # showList :: [Environment] -> ShowS # | |
Eq Environment Source # | |
Defined in Rollbar.Client.Settings |
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.
Constructors
RequestModifiers | |
Fields
|
Instances
FromJSON RequestModifiers Source # | |
Defined in Rollbar.Client.Settings Methods parseJSON :: Value -> Parser RequestModifiers # parseJSONList :: Value -> Parser [RequestModifiers] # | |
Show RequestModifiers Source # | |
Defined in Rollbar.Client.Settings Methods showsPrec :: Int -> RequestModifiers -> ShowS # show :: RequestModifiers -> String # showList :: [RequestModifiers] -> ShowS # | |
Eq RequestModifiers Source # | |
Defined in Rollbar.Client.Settings Methods (==) :: 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.