ekg-bosun 1.0.1 → 1.0.2
raw patch · 3 files changed
+25/−18 lines, 3 filesdep ~http-client
Dependency ranges changed: http-client
Files
- Changelog.md +6/−0
- ekg-bosun.cabal +2/−2
- src/System/Remote/Monitoring/Bosun.hs +17/−16
Changelog.md view
@@ -1,3 +1,9 @@+## 1.0.2++* Increase upper-bound of http-client to <0.5.+* Avoid ever posting `null`. Some metrics that are `Double` may post `null` if+ they are NaN or infinity - in this case we filter the submissions out.+ ## 1.0.1 * Relax dependencies for aeson, http-client, text, network and network-uri.
ekg-bosun.cabal view
@@ -1,5 +1,5 @@ name: ekg-bosun-version: 1.0.1+version: 1.0.2 synopsis: Send ekg metrics to a Bosun instance homepage: http://github.com/ocharles/ekg-bosun license: BSD3@@ -22,7 +22,7 @@ aeson >= 0.7 && < 0.9, base >=4.7 && <4.8, ekg-core >=0.1 && <0.2,- http-client >= 0.3.7 && < 0.4,+ http-client >= 0.3.7 && < 0.5, lens, text >=0.11 && <1.3, time >=1.4 && <1.5,
src/System/Remote/Monitoring/Bosun.hs view
@@ -135,23 +135,24 @@ return () ametric n v t =- Aeson.object [ "metric" .= n- , "value" .= v- , "timestamp" .= (Time.formatTime defaultTimeLocale "%s" t)- , "tags" .= Aeson.Object (Aeson.toJSON <$> tags opts)- ]+ [ Aeson.object [ "metric" .= n+ , "value" .= v+ , "timestamp" .= (Time.formatTime defaultTimeLocale "%s" t)+ , "tags" .= Aeson.Object (Aeson.toJSON <$> tags opts)+ ]+ | Aeson.toJSON v /= Aeson.Null+ ] metrics n v t = case v of- EKG.Counter i -> [ ametric n i t ]- EKG.Gauge i -> [ ametric n i t ]- EKG.Distribution stats- | Stats.count stats > 0- -> [ ametric (n <> ".count") (Stats.count stats) t- , ametric (n <> ".sum") (Stats.sum stats) t- , ametric (n <> ".min") (Stats.min stats) t- , ametric (n <> ".max") (Stats.max stats) t- , ametric (n <> ".mean") (Stats.mean stats) t- , ametric (n <> ".variance") (Stats.variance stats) t- ]+ EKG.Counter i -> ametric n i t+ EKG.Gauge i -> ametric n i t+ EKG.Distribution stats ->+ concat [ ametric (n <> ".count") (Stats.count stats) t+ , ametric (n <> ".sum") (Stats.sum stats) t+ , ametric (n <> ".min") (Stats.min stats) t+ , ametric (n <> ".max") (Stats.max stats) t+ , ametric (n <> ".mean") (Stats.mean stats) t+ , ametric (n <> ".variance") (Stats.variance stats) t+ ] _ -> []