Copyright | (c) Hardy Jones 2017 |
---|---|
License | BSD3 |
Maintainer | jones3.hardy@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Provides a data type that subsumes most of what Rollbar expects for "item"s.
See Rollbar's Data Format for more details.
Synopsis
- debug :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers)
- info :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers)
- warning :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers)
- error :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers)
- critical :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers)
- data Item a headers = Item {
- accessToken :: AccessToken
- itemData :: Data a headers
- module Rollbar.AccessToken
- newtype AccessToken = AccessToken Text
- module Rollbar.Item.Data
- data Data body headers = Data {
- body :: Body body
- codeVersion :: Maybe CodeVersion
- context :: Maybe Context
- custom :: Maybe (HashMap Text Value)
- environment :: Environment
- fingerprint :: Maybe Fingerprint
- framework :: Maybe Framework
- language :: Hardcoded "haskell"
- level :: Level
- notifier :: Notifier
- person :: Maybe Person
- platform :: Platform
- request :: Maybe (Request headers)
- server :: Maybe Server
- timestamp :: Maybe UTCTime
- title :: Maybe Title
- uuid :: Maybe UUID4
- newtype Context = Context Text
- newtype Fingerprint = Fingerprint Text
- newtype Framework = Framework Text
- newtype Title = Title Text
- newtype UUID4 = UUID4 UUID
- module Rollbar.Item.Body
- data Body arbitrary = Message {
- messageBody :: MessageBody
- messageData :: arbitrary
- newtype MessageBody = MessageBody Text
- module Rollbar.Item.Environment
- newtype Environment = Environment Text
- module Rollbar.Item.Level
- data Level
- module Rollbar.Item.CodeVersion
- data CodeVersion
- module Rollbar.Item.Hardcoded
- data Hardcoded (symbol :: Symbol) = Hardcoded
- module Rollbar.Item.MissingHeaders
- newtype MissingHeaders (headers :: [Symbol]) = MissingHeaders RequestHeaders
- module Rollbar.Item.Person
- data Person = Person {}
- newtype Email = Email Text
- newtype Id = Id Text
- newtype Username = Username Text
- module Rollbar.Item.Request
- newtype Get = Get Query
- newtype IP = IP SockAddr
- newtype Method = Method ByteString
- newtype MissingHeaders (headers :: [Symbol]) = MissingHeaders RequestHeaders
- newtype QueryString = QueryString ByteString
- newtype RawBody = RawBody ByteString
- newtype URL = URL (Maybe ByteString, [Text])
- module Rollbar.Item.Server
- data Server = Server {}
- newtype Branch = Branch Text
- newtype Root = Root Text
Data helpers
These functions are probably what you want to use most of the time.
They create a Data
with lots of data prefilled.
You can then override what you need with record updates.
debug :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #
info :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #
warning :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #
error :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #
critical :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #
Item
The thing we actually give to Rollbar.
Item | |
|
Instances
Eq a => Eq (Item a headers) Source # | |
Show a => Show (Item a headers) Source # | |
Generic (Item a headers) Source # | |
(RemoveHeaders headers, ToJSON a) => ToJSON (Item a headers) Source # | |
Defined in Rollbar.Item | |
FromJSON a => FromJSON (Item a headers) Source # | |
type Rep (Item a headers) Source # | |
Defined in Rollbar.Item type Rep (Item a headers) = D1 (MetaData "Item" "Rollbar.Item" "rollbar-hs-0.3.1.0-AHXin9WUqD3IOtR3mTqHpy" False) (C1 (MetaCons "Item" PrefixI True) (S1 (MetaSel (Just "accessToken") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AccessToken) :*: S1 (MetaSel (Just "itemData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Data a headers)))) |
Item data
module Rollbar.AccessToken
newtype AccessToken Source #
Should have the scope "post_server_item".
Instances
Eq AccessToken Source # | |
Defined in Rollbar.AccessToken (==) :: AccessToken -> AccessToken -> Bool # (/=) :: AccessToken -> AccessToken -> Bool # | |
Show AccessToken Source # | |
Defined in Rollbar.AccessToken showsPrec :: Int -> AccessToken -> ShowS # show :: AccessToken -> String # showList :: [AccessToken] -> ShowS # | |
IsString AccessToken Source # | |
Defined in Rollbar.AccessToken fromString :: String -> AccessToken # | |
ToJSON AccessToken Source # | |
Defined in Rollbar.AccessToken toJSON :: AccessToken -> Value # toEncoding :: AccessToken -> Encoding # toJSONList :: [AccessToken] -> Value # toEncodingList :: [AccessToken] -> Encoding # | |
FromJSON AccessToken Source # | |
Defined in Rollbar.AccessToken parseJSON :: Value -> Parser AccessToken # parseJSONList :: Value -> Parser [AccessToken] # |
module Rollbar.Item.Data
data Data body headers Source #
The main payload of an item. Most of this is metadata.
N.B. While it's entirely possible for you to create one of these yourself,
it's usually easier to use helpers like info
and error
.
Data | |
|
Instances
The place in the code where this item came from.
newtype Fingerprint Source #
How to group the item.
Instances
Eq Fingerprint Source # | |
Defined in Rollbar.Item.Data (==) :: Fingerprint -> Fingerprint -> Bool # (/=) :: Fingerprint -> Fingerprint -> Bool # | |
Show Fingerprint Source # | |
Defined in Rollbar.Item.Data showsPrec :: Int -> Fingerprint -> ShowS # show :: Fingerprint -> String # showList :: [Fingerprint] -> ShowS # | |
IsString Fingerprint Source # | |
Defined in Rollbar.Item.Data fromString :: String -> Fingerprint # | |
ToJSON Fingerprint Source # | |
Defined in Rollbar.Item.Data toJSON :: Fingerprint -> Value # toEncoding :: Fingerprint -> Encoding # toJSONList :: [Fingerprint] -> Value # toEncodingList :: [Fingerprint] -> Encoding # | |
FromJSON Fingerprint Source # | |
Defined in Rollbar.Item.Data parseJSON :: Value -> Parser Fingerprint # parseJSONList :: Value -> Parser [Fingerprint] # |
The framework that is using this package. E.g. "scotty", "servant", "yesod"
The title of the item.
A unique identifier for each item.
Required data
module Rollbar.Item.Body
This is the actual data that you want to give to Rollbar. Most of the rest of Rollbar is metadata.
Message | No stack trace, just a message and some arbitrary data. |
|
Instances
Eq arbitrary => Eq (Body arbitrary) Source # | |
Show arbitrary => Show (Body arbitrary) Source # | |
Generic (Body arbitrary) Source # | |
ToJSON arbitrary => ToJSON (Body arbitrary) Source # | |
Defined in Rollbar.Item.Body | |
FromJSON arbitrary => FromJSON (Body arbitrary) Source # | |
type Rep (Body arbitrary) Source # | |
Defined in Rollbar.Item.Body type Rep (Body arbitrary) = D1 (MetaData "Body" "Rollbar.Item.Body" "rollbar-hs-0.3.1.0-AHXin9WUqD3IOtR3mTqHpy" False) (C1 (MetaCons "Message" PrefixI True) (S1 (MetaSel (Just "messageBody") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 MessageBody) :*: S1 (MetaSel (Just "messageData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 arbitrary))) |
newtype MessageBody Source #
The primary message text to send to Rollbar.
Instances
Eq MessageBody Source # | |
Defined in Rollbar.Item.Body (==) :: MessageBody -> MessageBody -> Bool # (/=) :: MessageBody -> MessageBody -> Bool # | |
Show MessageBody Source # | |
Defined in Rollbar.Item.Body showsPrec :: Int -> MessageBody -> ShowS # show :: MessageBody -> String # showList :: [MessageBody] -> ShowS # | |
IsString MessageBody Source # | |
Defined in Rollbar.Item.Body fromString :: String -> MessageBody # | |
ToJSON MessageBody Source # | |
Defined in Rollbar.Item.Body toJSON :: MessageBody -> Value # toEncoding :: MessageBody -> Encoding # toJSONList :: [MessageBody] -> Value # toEncodingList :: [MessageBody] -> Encoding # | |
FromJSON MessageBody Source # | |
Defined in Rollbar.Item.Body parseJSON :: Value -> Parser MessageBody # parseJSONList :: Value -> Parser [MessageBody] # |
module Rollbar.Item.Environment
newtype Environment Source #
Should be something meaningful to your program. E.g. "development", "production", "staging"
Instances
Eq Environment Source # | |
Defined in Rollbar.Item.Environment (==) :: Environment -> Environment -> Bool # (/=) :: Environment -> Environment -> Bool # | |
Show Environment Source # | |
Defined in Rollbar.Item.Environment showsPrec :: Int -> Environment -> ShowS # show :: Environment -> String # showList :: [Environment] -> ShowS # | |
IsString Environment Source # | |
Defined in Rollbar.Item.Environment fromString :: String -> Environment # | |
ToJSON Environment Source # | |
Defined in Rollbar.Item.Environment toJSON :: Environment -> Value # toEncoding :: Environment -> Encoding # toJSONList :: [Environment] -> Value # toEncodingList :: [Environment] -> Encoding # | |
FromJSON Environment Source # | |
Defined in Rollbar.Item.Environment parseJSON :: Value -> Parser Environment # parseJSONList :: Value -> Parser [Environment] # |
module Rollbar.Item.Level
Corresponds to the levels Rollbar allows in order of severity.
Instances
Bounded Level Source # | |
Enum Level Source # | |
Eq Level Source # | |
Ord Level Source # | |
Show Level Source # | |
Generic Level Source # | |
ToJSON Level Source # | |
Defined in Rollbar.Item.Level | |
FromJSON Level Source # | |
type Rep Level Source # | |
Defined in Rollbar.Item.Level type Rep Level = D1 (MetaData "Level" "Rollbar.Item.Level" "rollbar-hs-0.3.1.0-AHXin9WUqD3IOtR3mTqHpy" False) ((C1 (MetaCons "Debug" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Info" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "Warning" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "Error" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Critical" PrefixI False) (U1 :: * -> *)))) |
Optional data
module Rollbar.Item.CodeVersion
data CodeVersion Source #
Rollbar supports different ways to say what version the code is.
SemVer Text | Good ole SemVer.
It's |
Number Int | Plain integers. |
SHA Text | Should be a Git SHA. |
Instances
module Rollbar.Item.Hardcoded
data Hardcoded (symbol :: Symbol) Source #
This is basically Proxy
with the variable restricted to Symbol
.
It's mostly useful so a value can be insert into a JSON blob easily.
module Rollbar.Item.MissingHeaders
newtype MissingHeaders (headers :: [Symbol]) Source #
The request headers with some missing
This is useful for removing sensitive information
like the Authorization
header.
Instances
Eq (MissingHeaders headers) Source # | |
Defined in Rollbar.Item.MissingHeaders (==) :: MissingHeaders headers -> MissingHeaders headers -> Bool # (/=) :: MissingHeaders headers -> MissingHeaders headers -> Bool # | |
Show (MissingHeaders headers) Source # | |
Defined in Rollbar.Item.MissingHeaders showsPrec :: Int -> MissingHeaders headers -> ShowS # show :: MissingHeaders headers -> String # showList :: [MissingHeaders headers] -> ShowS # | |
RemoveHeaders headers => ToJSON (MissingHeaders headers) Source # | |
Defined in Rollbar.Item.MissingHeaders toJSON :: MissingHeaders headers -> Value # toEncoding :: MissingHeaders headers -> Encoding # toJSONList :: [MissingHeaders headers] -> Value # toEncodingList :: [MissingHeaders headers] -> Encoding # | |
FromJSON (MissingHeaders headers) Source # | |
Defined in Rollbar.Item.MissingHeaders parseJSON :: Value -> Parser (MissingHeaders headers) # parseJSONList :: Value -> Parser [MissingHeaders headers] # |
module Rollbar.Item.Person
Instances
Eq Person Source # | |
Show Person Source # | |
Generic Person Source # | |
ToJSON Person Source # | |
Defined in Rollbar.Item.Person | |
FromJSON Person Source # | |
type Rep Person Source # | |
Defined in Rollbar.Item.Person type Rep Person = D1 (MetaData "Person" "Rollbar.Item.Person" "rollbar-hs-0.3.1.0-AHXin9WUqD3IOtR3mTqHpy" False) (C1 (MetaCons "Person" PrefixI True) (S1 (MetaSel (Just "id") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Id) :*: (S1 (MetaSel (Just "username") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Username)) :*: S1 (MetaSel (Just "email") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Email))))) |
The user's email.
The user's identifier. This uniquely identifies a Person
to Rollbar.
The user's name.
module Rollbar.Item.Request
The query string parameters as a more useful data structure.
The IP address of the client.
The HTTP Verb
Instances
Eq Method Source # | |
Show Method Source # | |
Generic Method Source # | |
ToJSON Method Source # | |
Defined in Rollbar.Item.Request | |
FromJSON Method Source # | |
type Rep Method Source # | |
Defined in Rollbar.Item.Request type Rep Method = D1 (MetaData "Method" "Rollbar.Item.Request" "rollbar-hs-0.3.1.0-AHXin9WUqD3IOtR3mTqHpy" True) (C1 (MetaCons "Method" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString))) |
newtype MissingHeaders (headers :: [Symbol]) Source #
The request headers with some missing
This is useful for removing sensitive information
like the Authorization
header.
Instances
Eq (MissingHeaders headers) Source # | |
Defined in Rollbar.Item.MissingHeaders (==) :: MissingHeaders headers -> MissingHeaders headers -> Bool # (/=) :: MissingHeaders headers -> MissingHeaders headers -> Bool # | |
Show (MissingHeaders headers) Source # | |
Defined in Rollbar.Item.MissingHeaders showsPrec :: Int -> MissingHeaders headers -> ShowS # show :: MissingHeaders headers -> String # showList :: [MissingHeaders headers] -> ShowS # | |
RemoveHeaders headers => ToJSON (MissingHeaders headers) Source # | |
Defined in Rollbar.Item.MissingHeaders toJSON :: MissingHeaders headers -> Value # toEncoding :: MissingHeaders headers -> Encoding # toJSONList :: [MissingHeaders headers] -> Value # toEncodingList :: [MissingHeaders headers] -> Encoding # | |
FromJSON (MissingHeaders headers) Source # | |
Defined in Rollbar.Item.MissingHeaders parseJSON :: Value -> Parser (MissingHeaders headers) # parseJSONList :: Value -> Parser [MissingHeaders headers] # |
newtype QueryString Source #
The raw querystring.
Instances
The raw request body as a ByteString
.
Instances
Eq RawBody Source # | |
Show RawBody Source # | |
IsString RawBody Source # | |
Defined in Rollbar.Item.Request fromString :: String -> RawBody # | |
Generic RawBody Source # | |
ToJSON RawBody Source # | |
Defined in Rollbar.Item.Request | |
FromJSON RawBody Source # | |
type Rep RawBody Source # | |
Defined in Rollbar.Item.Request type Rep RawBody = D1 (MetaData "RawBody" "Rollbar.Item.Request" "rollbar-hs-0.3.1.0-AHXin9WUqD3IOtR3mTqHpy" True) (C1 (MetaCons "RawBody" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString))) |
The URL as a slightly more useful structure.
URL (Maybe ByteString, [Text]) |
module Rollbar.Item.Server
Information about the server using this package.
Instances
Eq Server Source # | |
Show Server Source # | |
Generic Server Source # | |
ToJSON Server Source # | |
Defined in Rollbar.Item.Server | |
FromJSON Server Source # | |
type Rep Server Source # | |
Defined in Rollbar.Item.Server type Rep Server = D1 (MetaData "Server" "Rollbar.Item.Server" "rollbar-hs-0.3.1.0-AHXin9WUqD3IOtR3mTqHpy" False) (C1 (MetaCons "Server" PrefixI True) ((S1 (MetaSel (Just "host") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe HostName)) :*: S1 (MetaSel (Just "root") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Root))) :*: (S1 (MetaSel (Just "branch") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Branch)) :*: S1 (MetaSel (Just "serverCodeVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe CodeVersion))))) |
The git branch the server is running on.