wai-middleware-rollbar-0.8.0: Middleware that communicates to Rollbar.

Copyright(c) Hardy Jones 2017
LicenseBSD3
Maintainerjones3.hardy@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Rollbar.Item

Contents

Description

Provides a data type that subsumes most of what Rollbar expects for "item"s.

See Rollbar's Data Format for more details.

Synopsis

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 #

Creates Data with the level set to Debug.

info :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #

Creates Data with the level set to Info.

warning :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #

Creates Data with the level set to Warning.

error :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #

Creates Data with the level set to Error.

critical :: Environment -> Maybe MessageBody -> payload -> Data payload ("Authorization" ': headers) Source #

Creates Data with the level set to Critical.

Item

data Item a headers Source #

The thing we actually give to Rollbar.

Constructors

Item 

Fields

Instances

Eq a => Eq (Item a headers) Source # 

Methods

(==) :: Item a headers -> Item a headers -> Bool #

(/=) :: Item a headers -> Item a headers -> Bool #

Show a => Show (Item a headers) Source # 

Methods

showsPrec :: Int -> Item a headers -> ShowS #

show :: Item a headers -> String #

showList :: [Item a headers] -> ShowS #

Generic (Item a headers) Source # 

Associated Types

type Rep (Item a headers) :: * -> * #

Methods

from :: Item a headers -> Rep (Item a headers) x #

to :: Rep (Item a headers) x -> Item a headers #

FromJSON a => FromJSON (Item a headers) Source # 

Methods

parseJSON :: Value -> Parser (Item a headers) #

parseJSONList :: Value -> Parser [Item a headers] #

(RemoveHeaders headers, ToJSON a) => ToJSON (Item a headers) Source # 

Methods

toJSON :: Item a headers -> Value #

toEncoding :: Item a headers -> Encoding #

toJSONList :: [Item a headers] -> Value #

toEncodingList :: [Item a headers] -> Encoding #

type Rep (Item a headers) Source # 
type Rep (Item a headers) = D1 (MetaData "Item" "Rollbar.Item" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" False) (C1 (MetaCons "Item" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "accessToken") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 AccessToken)) (S1 (MetaSel (Just Symbol "itemData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Data a headers)))))

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

Eq body => Eq (Data body headers) Source # 

Methods

(==) :: Data body headers -> Data body headers -> Bool #

(/=) :: Data body headers -> Data body headers -> Bool #

Show body => Show (Data body headers) Source # 

Methods

showsPrec :: Int -> Data body headers -> ShowS #

show :: Data body headers -> String #

showList :: [Data body headers] -> ShowS #

Generic (Data body headers) Source # 

Associated Types

type Rep (Data body headers) :: * -> * #

Methods

from :: Data body headers -> Rep (Data body headers) x #

to :: Rep (Data body headers) x -> Data body headers #

FromJSON body => FromJSON (Data body headers) Source # 

Methods

parseJSON :: Value -> Parser (Data body headers) #

parseJSONList :: Value -> Parser [Data body headers] #

(RemoveHeaders headers, ToJSON body) => ToJSON (Data body headers) Source # 

Methods

toJSON :: Data body headers -> Value #

toEncoding :: Data body headers -> Encoding #

toJSONList :: [Data body headers] -> Value #

toEncodingList :: [Data body headers] -> Encoding #

type Rep (Data body headers) Source # 
type Rep (Data body headers) = D1 (MetaData "Data" "Rollbar.Item.Data" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" False) (C1 (MetaCons "Data" PrefixI True) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "body") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Body body))) (S1 (MetaSel (Just Symbol "codeVersion") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe CodeVersion)))) ((:*:) (S1 (MetaSel (Just Symbol "context") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Context))) (S1 (MetaSel (Just Symbol "custom") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (HashMap Text Value)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "environment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Environment)) (S1 (MetaSel (Just Symbol "fingerprint") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Fingerprint)))) ((:*:) (S1 (MetaSel (Just Symbol "framework") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Framework))) (S1 (MetaSel (Just Symbol "language") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Hardcoded "haskell")))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "level") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Level)) (S1 (MetaSel (Just Symbol "notifier") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Notifier))) ((:*:) (S1 (MetaSel (Just Symbol "person") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Person))) (S1 (MetaSel (Just Symbol "platform") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Platform)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "request") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Request headers)))) (S1 (MetaSel (Just Symbol "server") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Server)))) ((:*:) (S1 (MetaSel (Just Symbol "timestamp") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe UTCTime))) ((:*:) (S1 (MetaSel (Just Symbol "title") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Title))) (S1 (MetaSel (Just Symbol "uuid") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe UUID4)))))))))

newtype Context Source #

The place in the code where this item came from.

Constructors

Context Text 

newtype Title Source #

The title of the item.

Constructors

Title Text 

newtype UUID4 Source #

A unique identifier for each item.

Constructors

UUID4 UUID 

Instances

Eq UUID4 Source # 

Methods

(==) :: UUID4 -> UUID4 -> Bool #

(/=) :: UUID4 -> UUID4 -> Bool #

Show UUID4 Source # 

Methods

showsPrec :: Int -> UUID4 -> ShowS #

show :: UUID4 -> String #

showList :: [UUID4] -> ShowS #

Generic UUID4 Source # 

Associated Types

type Rep UUID4 :: * -> * #

Methods

from :: UUID4 -> Rep UUID4 x #

to :: Rep UUID4 x -> UUID4 #

FromJSON UUID4 Source # 
ToJSON UUID4 Source # 
type Rep UUID4 Source # 
type Rep UUID4 = D1 (MetaData "UUID4" "Rollbar.Item.Data" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" True) (C1 (MetaCons "UUID4" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UUID)))

Required data

data Body arbitrary Source #

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

Instances

Eq arbitrary => Eq (Body arbitrary) Source # 

Methods

(==) :: Body arbitrary -> Body arbitrary -> Bool #

(/=) :: Body arbitrary -> Body arbitrary -> Bool #

Show arbitrary => Show (Body arbitrary) Source # 

Methods

showsPrec :: Int -> Body arbitrary -> ShowS #

show :: Body arbitrary -> String #

showList :: [Body arbitrary] -> ShowS #

Generic (Body arbitrary) Source # 

Associated Types

type Rep (Body arbitrary) :: * -> * #

Methods

from :: Body arbitrary -> Rep (Body arbitrary) x #

to :: Rep (Body arbitrary) x -> Body arbitrary #

FromJSON arbitrary => FromJSON (Body arbitrary) Source # 

Methods

parseJSON :: Value -> Parser (Body arbitrary) #

parseJSONList :: Value -> Parser [Body arbitrary] #

ToJSON arbitrary => ToJSON (Body arbitrary) Source # 

Methods

toJSON :: Body arbitrary -> Value #

toEncoding :: Body arbitrary -> Encoding #

toJSONList :: [Body arbitrary] -> Value #

toEncodingList :: [Body arbitrary] -> Encoding #

type Rep (Body arbitrary) Source # 
type Rep (Body arbitrary) = D1 (MetaData "Body" "Rollbar.Item.Body" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" False) (C1 (MetaCons "Message" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "messageBody") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 MessageBody)) (S1 (MetaSel (Just Symbol "messageData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 arbitrary))))

data Level Source #

Corresponds to the levels Rollbar allows in order of severity.

Constructors

Debug 
Info 
Warning 
Error 
Critical 

Instances

Bounded Level Source # 
Enum Level Source # 
Eq Level Source # 

Methods

(==) :: Level -> Level -> Bool #

(/=) :: Level -> Level -> Bool #

Ord Level Source # 

Methods

compare :: Level -> Level -> Ordering #

(<) :: Level -> Level -> Bool #

(<=) :: Level -> Level -> Bool #

(>) :: Level -> Level -> Bool #

(>=) :: Level -> Level -> Bool #

max :: Level -> Level -> Level #

min :: Level -> Level -> Level #

Show Level Source # 

Methods

showsPrec :: Int -> Level -> ShowS #

show :: Level -> String #

showList :: [Level] -> ShowS #

Generic Level Source # 

Associated Types

type Rep Level :: * -> * #

Methods

from :: Level -> Rep Level x #

to :: Rep Level x -> Level #

FromJSON Level Source # 
ToJSON Level Source # 
type Rep Level Source # 
type Rep Level = D1 (MetaData "Level" "Rollbar.Item.Level" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" 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

data CodeVersion Source #

Rollbar supports different ways to say what version the code is.

Constructors

SemVer Text

Good ole SemVer. It's Text because who knows if you actually got it right...

Number Int

Plain integers.

SHA Text

Should be a Git SHA.

data Hardcoded 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 

Instances

Eq (Hardcoded symbol) Source # 

Methods

(==) :: Hardcoded symbol -> Hardcoded symbol -> Bool #

(/=) :: Hardcoded symbol -> Hardcoded symbol -> Bool #

Show (Hardcoded symbol) Source # 

Methods

showsPrec :: Int -> Hardcoded symbol -> ShowS #

show :: Hardcoded symbol -> String #

showList :: [Hardcoded symbol] -> ShowS #

Generic (Hardcoded symbol) Source # 

Associated Types

type Rep (Hardcoded symbol) :: * -> * #

Methods

from :: Hardcoded symbol -> Rep (Hardcoded symbol) x #

to :: Rep (Hardcoded symbol) x -> Hardcoded symbol #

KnownSymbol symbol => FromJSON (Hardcoded symbol) Source # 

Methods

parseJSON :: Value -> Parser (Hardcoded symbol) #

parseJSONList :: Value -> Parser [Hardcoded symbol] #

KnownSymbol symbol => ToJSON (Hardcoded symbol) Source # 

Methods

toJSON :: Hardcoded symbol -> Value #

toEncoding :: Hardcoded symbol -> Encoding #

toJSONList :: [Hardcoded symbol] -> Value #

toEncodingList :: [Hardcoded symbol] -> Encoding #

type Rep (Hardcoded symbol) Source # 
type Rep (Hardcoded symbol) = D1 (MetaData "Hardcoded" "Rollbar.Item.Hardcoded" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" False) (C1 (MetaCons "Hardcoded" PrefixI False) U1)

newtype MissingHeaders headers Source #

The request headers with some missing

This is useful for removing sensitive information like the Authorization header.

Instances

Eq (MissingHeaders headers) Source # 

Methods

(==) :: MissingHeaders headers -> MissingHeaders headers -> Bool #

(/=) :: MissingHeaders headers -> MissingHeaders headers -> Bool #

Show (MissingHeaders headers) Source # 

Methods

showsPrec :: Int -> MissingHeaders headers -> ShowS #

show :: MissingHeaders headers -> String #

showList :: [MissingHeaders headers] -> ShowS #

FromJSON (MissingHeaders headers) Source # 
RemoveHeaders headers => ToJSON (MissingHeaders headers) Source # 

data Person Source #

The affected user.

The Email and Username associated with the latest Id will overwrite any previous.

Constructors

Person 

newtype Id Source #

The user's identifier. This uniquely identifies a Person to Rollbar.

Constructors

Id Text 

Instances

newtype Get Source #

The query string parameters as a more useful data structure.

Constructors

Get Query 

Instances

Eq Get Source # 

Methods

(==) :: Get -> Get -> Bool #

(/=) :: Get -> Get -> Bool #

Show Get Source # 

Methods

showsPrec :: Int -> Get -> ShowS #

show :: Get -> String #

showList :: [Get] -> ShowS #

Generic Get Source # 

Associated Types

type Rep Get :: * -> * #

Methods

from :: Get -> Rep Get x #

to :: Rep Get x -> Get #

FromJSON Get Source # 
ToJSON Get Source # 
type Rep Get Source # 
type Rep Get = D1 (MetaData "Get" "Rollbar.Item.Request" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" True) (C1 (MetaCons "Get" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Query)))

newtype IP Source #

The IP address of the client.

Constructors

IP SockAddr 

Instances

Eq IP Source # 

Methods

(==) :: IP -> IP -> Bool #

(/=) :: IP -> IP -> Bool #

Show IP Source # 

Methods

showsPrec :: Int -> IP -> ShowS #

show :: IP -> String #

showList :: [IP] -> ShowS #

Generic IP Source # 

Associated Types

type Rep IP :: * -> * #

Methods

from :: IP -> Rep IP x #

to :: Rep IP x -> IP #

FromJSON IP Source # 
ToJSON IP Source # 
type Rep IP Source # 
type Rep IP = D1 (MetaData "IP" "Rollbar.Item.Request" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" True) (C1 (MetaCons "IP" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SockAddr)))

newtype Method Source #

The HTTP Verb

Constructors

Method ByteString 

Instances

Eq Method Source # 

Methods

(==) :: Method -> Method -> Bool #

(/=) :: Method -> Method -> Bool #

Show Method Source # 
Generic Method Source # 

Associated Types

type Rep Method :: * -> * #

Methods

from :: Method -> Rep Method x #

to :: Rep Method x -> Method #

FromJSON Method Source # 
ToJSON Method Source # 
type Rep Method Source # 
type Rep Method = D1 (MetaData "Method" "Rollbar.Item.Request" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" True) (C1 (MetaCons "Method" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

newtype MissingHeaders headers Source #

The request headers with some missing

This is useful for removing sensitive information like the Authorization header.

Instances

Eq (MissingHeaders headers) Source # 

Methods

(==) :: MissingHeaders headers -> MissingHeaders headers -> Bool #

(/=) :: MissingHeaders headers -> MissingHeaders headers -> Bool #

Show (MissingHeaders headers) Source # 

Methods

showsPrec :: Int -> MissingHeaders headers -> ShowS #

show :: MissingHeaders headers -> String #

showList :: [MissingHeaders headers] -> ShowS #

FromJSON (MissingHeaders headers) Source # 
RemoveHeaders headers => ToJSON (MissingHeaders headers) Source # 

newtype RawBody Source #

The raw request body as a ByteString.

Constructors

RawBody ByteString 

Instances

Eq RawBody Source # 

Methods

(==) :: RawBody -> RawBody -> Bool #

(/=) :: RawBody -> RawBody -> Bool #

Show RawBody Source # 
IsString RawBody Source # 

Methods

fromString :: String -> RawBody #

Generic RawBody Source # 

Associated Types

type Rep RawBody :: * -> * #

Methods

from :: RawBody -> Rep RawBody x #

to :: Rep RawBody x -> RawBody #

FromJSON RawBody Source # 
ToJSON RawBody Source # 
type Rep RawBody Source # 
type Rep RawBody = D1 (MetaData "RawBody" "Rollbar.Item.Request" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" True) (C1 (MetaCons "RawBody" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ByteString)))

newtype URL Source #

The URL as a slightly more useful structure.

Constructors

URL (Maybe ByteString, [Text]) 

Instances

Eq URL Source # 

Methods

(==) :: URL -> URL -> Bool #

(/=) :: URL -> URL -> Bool #

Show URL Source # 

Methods

showsPrec :: Int -> URL -> ShowS #

show :: URL -> String #

showList :: [URL] -> ShowS #

Generic URL Source # 

Associated Types

type Rep URL :: * -> * #

Methods

from :: URL -> Rep URL x #

to :: Rep URL x -> URL #

FromJSON URL Source # 
ToJSON URL Source # 
type Rep URL Source # 
type Rep URL = D1 (MetaData "URL" "Rollbar.Item.Request" "wai-middleware-rollbar-0.8.0-7XfDuZttbz7B131nMvMhmH" True) (C1 (MetaCons "URL" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe ByteString, [Text]))))

data Server Source #

Information about the server using this package.

Constructors

Server 

Fields

newtype Branch Source #

The git branch the server is running on.

Constructors

Branch Text 

newtype Root Source #

The root directory.

Constructors

Root Text