Copyright | (c) Hardy Jones 2017 |
---|---|
License | BSD3 |
Maintainer | jones3.hardy@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Rollbar.Item
Description
Provides a data type that subsumes most of what Rollbar expects for "item"s.
See Rollbar's Data Format for more details.
- 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.
Constructors
Item | |
Fields
|
Item data
module Rollbar.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
.
Constructors
Data | |
Fields
|
Instances
The place in the code where this item came from.
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.
Constructors
Message | No stack trace, just a message and some arbitrary data. |
Fields
|
newtype MessageBody Source #
The primary message text to send to Rollbar.
Constructors
MessageBody Text |
module Rollbar.Item.Environment
newtype Environment Source #
Should be something meaningful to your program. E.g. "development", "production", "staging"
Constructors
Environment Text |
module Rollbar.Item.Level
Corresponds to the levels Rollbar allows in order of severity.
Optional data
module Rollbar.Item.CodeVersion
data CodeVersion Source #
Rollbar supports different ways to say what version the code is.
Constructors
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.
Constructors
Hardcoded |
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.
Constructors
MissingHeaders RequestHeaders |
Instances
Eq (MissingHeaders headers) Source # | |
Show (MissingHeaders headers) Source # | |
RemoveHeaders headers => ToJSON (MissingHeaders headers) Source # | |
FromJSON (MissingHeaders headers) Source # | |
module Rollbar.Item.Person
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
Constructors
Method ByteString |
newtype MissingHeaders (headers :: [Symbol]) Source #
The request headers with some missing
This is useful for removing sensitive information
like the Authorization
header.
Constructors
MissingHeaders RequestHeaders |
Instances
Eq (MissingHeaders headers) Source # | |
Show (MissingHeaders headers) Source # | |
RemoveHeaders headers => ToJSON (MissingHeaders headers) Source # | |
FromJSON (MissingHeaders headers) Source # | |
The raw request body as a ByteString
.
Constructors
RawBody ByteString |
The URL as a slightly more useful structure.
Constructors
URL (Maybe ByteString, [Text]) |
module Rollbar.Item.Server
Information about the server using this package.
Constructors
Server | |
The git branch the server is running on.