Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Network/Datadog/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ instance ToJSON MetricPoints where
toJSON (Counter ps) = toJSON $ fmap (first Timestamp) ps

instance ToJSON Metric where
toJSON m = object ks
toJSON m = object (g ks)
where
g = maybe id (\x y -> ("interval" .= x) : y) $ metricInterval m
f = maybe id (\x y -> ("host" .= x) : y) $ metricHost m
ks = f [ "metric" .= metricName m
, "points" .= metricPoints m
Expand Down
3 changes: 2 additions & 1 deletion src/Network/Datadog/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ data Metric = Metric
, metricPoints :: MetricPoints
, metricHost :: Maybe Text
, metricTags :: [Text]
, metricInterval :: Maybe Integer
}

-- | Each monitor is of a specific type, which determines what sort of check
-- the monitor performs.
data MonitorType = MetricAlert
Expand Down