datadog-0.2.2.0: Datadog client for Haskell. Supports both the HTTP API and StatsD.

Safe HaskellNone
LanguageHaskell2010

Network.StatsD.Datadog

Contents

Description

DogStatsD accepts custom application metrics points over UDP, and then periodically aggregates and forwards the metrics to Datadog, where they can be graphed on dashboards. The data is sent by using a client library such as this one that communicates with a DogStatsD server.

Synopsis

Client interface

data DogStatsSettings #

Constructors

DogStatsSettings 

Fields

send :: (MonadBase IO m, ToStatsD v) => StatsClient -> v -> m () #

Send a Metric, Event, or StatusCheck to the DogStatsD server.

Since UDP is used to send the events, there is no ack that sent values are successfully dealt with.

withDogStatsD defaultSettings $ \client -> do
  send client $ event "Wombat attack" "A host of mighty wombats has breached the gates"
  send client $ metric "wombat.force_count" Gauge (9001 :: Int)
  send client $ serviceCheck "Wombat Radar" ServiceOk

Data supported by DogStatsD

metric :: ToMetricValue a => MetricName -> MetricType -> a -> Metric #

Smart Metric constructor. Use the lens functions to set the optional fields.

data Metric #

Metric

The fields accessible through corresponding lenses are:

Instances
ToStatsD Metric # 
Instance details

Defined in Network.StatsD.Datadog

Methods

toStatsD :: Metric -> Utf8Builder ()

HasType' Metric MetricType # 
Instance details

Defined in Network.StatsD.Datadog

HasSampleRate Metric Double # 
Instance details

Defined in Network.StatsD.Datadog

HasName Metric MetricName # 
Instance details

Defined in Network.StatsD.Datadog

HasTags Metric [Tag] # 
Instance details

Defined in Network.StatsD.Datadog

Methods

tags :: Lens' Metric [Tag] #

newtype MetricName #

Constructors

MetricName 

Fields

Instances
HasName Metric MetricName # 
Instance details

Defined in Network.StatsD.Datadog

data MetricType #

Constructors

Gauge

Gauges measure the value of a particular thing at a particular time, like the amount of fuel in a car’s gas tank or the number of users connected to a system.

Counter

Counters track how many times something happened per second, like the number of database requests or page views.

Timer

StatsD only supports histograms for timing, not generic values (like the size of uploaded files or the number of rows returned from a query). Timers are essentially a special case of histograms, so they are treated in the same manner by DogStatsD for backwards compatibility.

Histogram

Histograms track the statistical distribution of a set of values, like the duration of a number of database queries or the size of files uploaded by users. Each histogram will track the average, the minimum, the maximum, the median and the 95th percentile.

Set

Sets are used to count the number of unique elements in a group. If you want to track the number of unique visitor to your site, sets are a great way to do that.

Instances
HasType' Metric MetricType # 
Instance details

Defined in Network.StatsD.Datadog

event :: Text -> Text -> Event #

Smart Event constructor. Use the lens functions to set the optional fields.

data Event #

Instances
ToStatsD Event # 
Instance details

Defined in Network.StatsD.Datadog

Methods

toStatsD :: Event -> Utf8Builder ()

HasTitle Event Text # 
Instance details

Defined in Network.StatsD.Datadog

Methods

title :: Lens' Event Text #

HasText Event Text # 
Instance details

Defined in Network.StatsD.Datadog

Methods

text :: Lens' Event Text #

HasTags Event [Tag] # 
Instance details

Defined in Network.StatsD.Datadog

Methods

tags :: Lens' Event [Tag] #

HasSourceTypeName Event (Maybe Text) # 
Instance details

Defined in Network.StatsD.Datadog

HasPriority Event (Maybe Priority) # 
Instance details

Defined in Network.StatsD.Datadog

HasHostname Event (Maybe Text) # 
Instance details

Defined in Network.StatsD.Datadog

HasDateHappened Event (Maybe UTCTime) # 
Instance details

Defined in Network.StatsD.Datadog

HasAlertType Event (Maybe AlertType) # 
Instance details

Defined in Network.StatsD.Datadog

HasAggregationKey Event (Maybe Text) # 
Instance details

Defined in Network.StatsD.Datadog

data ServiceCheckStatus #

Instances
Enum ServiceCheckStatus # 
Instance details

Defined in Network.StatsD.Datadog

Eq ServiceCheckStatus # 
Instance details

Defined in Network.StatsD.Datadog

Ord ServiceCheckStatus # 
Instance details

Defined in Network.StatsD.Datadog

Read ServiceCheckStatus # 
Instance details

Defined in Network.StatsD.Datadog

Show ServiceCheckStatus # 
Instance details

Defined in Network.StatsD.Datadog

HasStatus ServiceCheck ServiceCheckStatus # 
Instance details

Defined in Network.StatsD.Datadog

class ToStatsD a #

Convert an Event, Metric, or StatusCheck to their wire format.

Minimal complete definition

toStatsD

Instances
ToStatsD Metric # 
Instance details

Defined in Network.StatsD.Datadog

Methods

toStatsD :: Metric -> Utf8Builder ()

ToStatsD Event # 
Instance details

Defined in Network.StatsD.Datadog

Methods

toStatsD :: Event -> Utf8Builder ()

ToStatsD ServiceCheck # 
Instance details

Defined in Network.StatsD.Datadog

Optional fields

data Tag #

Tags are a Datadog specific extension to StatsD. They allow you to tag a metric with a dimension that’s meaningful to you and slice and dice along that dimension in your graphs. For example, if you wanted to measure the performance of two video rendering algorithms, you could tag the rendering time metric with the version of the algorithm you used.

Instances
HasTags Metric [Tag] # 
Instance details

Defined in Network.StatsD.Datadog

Methods

tags :: Lens' Metric [Tag] #

HasTags Event [Tag] # 
Instance details

Defined in Network.StatsD.Datadog

Methods

tags :: Lens' Event [Tag] #

HasTags ServiceCheck [Tag] # 
Instance details

Defined in Network.StatsD.Datadog

tag :: Text -> Text -> Tag #

Create a tag from a key-value pair. Useful for slicing and dicing events in Datadog.

Key and value text values are normalized by converting ":"s, "|"s, and "@"s to underscores ("_").

class ToMetricValue a where #

Converts a supported numeric type to the format understood by DogStatsD. Currently limited by BufferBuilder encoding options.

Minimal complete definition

encodeValue

Methods

encodeValue :: a -> Utf8Builder () #

Instances
ToMetricValue Double # 
Instance details

Defined in Network.StatsD.Datadog

ToMetricValue Int # 
Instance details

Defined in Network.StatsD.Datadog

Methods

encodeValue :: Int -> Utf8Builder () #

value :: ToMetricValue a => Setter Metric Metric (Utf8Builder ()) a #

Special setter to update the value of a Metric.

metric ("foo"" :: Text) Counter (1 :: Int) & value .~ (5 :: Double)

data Priority #

Constructors

Low 
Normal 
Instances
HasPriority Event (Maybe Priority) # 
Instance details

Defined in Network.StatsD.Datadog

data AlertType #

Constructors

Error 
Warning 
Info 
Success 
Instances
HasAlertType Event (Maybe AlertType) # 
Instance details

Defined in Network.StatsD.Datadog

class HasName s a | s -> a where #

Minimal complete definition

name

Methods

name :: Lens' s a #

Instances
HasName Metric MetricName # 
Instance details

Defined in Network.StatsD.Datadog

HasName ServiceCheck Text # 
Instance details

Defined in Network.StatsD.Datadog

class HasSampleRate s a | s -> a where #

Minimal complete definition

sampleRate

Methods

sampleRate :: Lens' s a #

Instances
HasSampleRate Metric Double # 
Instance details

Defined in Network.StatsD.Datadog

class HasType' s a | s -> a where #

Minimal complete definition

type'

Methods

type' :: Lens' s a #

Instances
HasType' Metric MetricType # 
Instance details

Defined in Network.StatsD.Datadog

class HasTags s a | s -> a where #

Minimal complete definition

tags

Methods

tags :: Lens' s a #

Instances
HasTags Metric [Tag] # 
Instance details

Defined in Network.StatsD.Datadog

Methods

tags :: Lens' Metric [Tag] #

HasTags Event [Tag] # 
Instance details

Defined in Network.StatsD.Datadog

Methods

tags :: Lens' Event [Tag] #

HasTags ServiceCheck [Tag] # 
Instance details

Defined in Network.StatsD.Datadog

class HasTitle s a | s -> a where #

Minimal complete definition

title

Methods

title :: Lens' s a #

Instances
HasTitle Event Text # 
Instance details

Defined in Network.StatsD.Datadog

Methods

title :: Lens' Event Text #

class HasText s a | s -> a where #

Minimal complete definition

text

Methods

text :: Lens' s a #

Instances
HasText Event Text # 
Instance details

Defined in Network.StatsD.Datadog

Methods

text :: Lens' Event Text #

class HasDateHappened s a | s -> a where #

Minimal complete definition

dateHappened

Methods

dateHappened :: Lens' s a #

class HasHostname s a | s -> a where #

Minimal complete definition

hostname

Methods

hostname :: Lens' s a #

Instances
HasHostname Event (Maybe Text) # 
Instance details

Defined in Network.StatsD.Datadog

HasHostname ServiceCheck (Maybe Text) # 
Instance details

Defined in Network.StatsD.Datadog

class HasAggregationKey s a | s -> a where #

Minimal complete definition

aggregationKey

Methods

aggregationKey :: Lens' s a #

Instances
HasAggregationKey Event (Maybe Text) # 
Instance details

Defined in Network.StatsD.Datadog

class HasPriority s a | s -> a where #

Minimal complete definition

priority

Methods

priority :: Lens' s a #

Instances
HasPriority Event (Maybe Priority) # 
Instance details

Defined in Network.StatsD.Datadog

class HasSourceTypeName s a | s -> a where #

Minimal complete definition

sourceTypeName

Methods

sourceTypeName :: Lens' s a #

Instances
HasSourceTypeName Event (Maybe Text) # 
Instance details

Defined in Network.StatsD.Datadog

class HasAlertType s a | s -> a where #

Minimal complete definition

alertType

Methods

alertType :: Lens' s a #

Instances
HasAlertType Event (Maybe AlertType) # 
Instance details

Defined in Network.StatsD.Datadog

class HasHost s a | s -> a where #

Minimal complete definition

host

Methods

host :: Lens' s a #

class HasPort s a | s -> a where #

Minimal complete definition

port

Methods

port :: Lens' s a #

Instances
HasPort DogStatsSettings Int # 
Instance details

Defined in Network.StatsD.Datadog

class HasStatus s a | s -> a where #

Minimal complete definition

status

Methods

status :: Lens' s a #

class HasMessage s a | s -> a where #

Minimal complete definition

message

Methods

message :: Lens' s a #

Instances
HasMessage ServiceCheck (Maybe Text) # 
Instance details

Defined in Network.StatsD.Datadog

Dummy client

data StatsClient #

Note that Dummy is not the only constructor, just the only publicly available one.

Constructors

Dummy

Just drops all stats.