ekg 0.4.0.15 → 0.4.1.0
raw patch · 5 files changed
+117/−55 lines, 5 filesdep ~aesondep ~basedep ~networknew-uploaderPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: aeson, base, network, text, time, transformers
API changes (from Hackage documentation)
+ System.Remote.Monitoring: forkServerNoHostname :: Int -> IO Server
+ System.Remote.Monitoring: forkServerNoHostnameWith :: Store -> Int -> IO Server
- System.Remote.Counter: data Counter :: *
+ System.Remote.Counter: data () => Counter
- System.Remote.Gauge: data Gauge :: *
+ System.Remote.Gauge: data () => Gauge
- System.Remote.Label: data Label :: *
+ System.Remote.Label: data () => Label
Files
- CHANGES.md +8/−0
- README.md +4/−10
- System/Remote/Monitoring.hs +32/−2
- System/Remote/Snap.hs +8/−5
- ekg.cabal +65/−38
CHANGES.md view
@@ -1,3 +1,11 @@+## 0.4.1.0 (2024-07-31)++* Support various newer GHCs by expanding bounds.++## 0.4.0.16 (2020-??-??)++* TBD.+ ## 0.4.0.15 (2018-03-20) * GHC 8.4 support.
README.md view
@@ -1,4 +1,4 @@-# EKG: Remote monitoring of running processes over HTTP [](https://hackage.haskell.org/package/ekg) [](http://travis-ci.org/tibbe/ekg)+# EKG: Remote monitoring of running processes over HTTP [](https://hackage.haskell.org/package/ekg) [](https://github.com/l0negamer/ekg/actions/workflows/haskell-ci.yml) This library lets you remotely monitor a running process over HTTP. It provides a simple way to integrate a monitoring server into any@@ -45,14 +45,8 @@ # Get involved! Please report bugs via the-[GitHub issue tracker](https://github.com/tibbe/ekg/issues).--Master [git repository](https://github.com/tibbe/ekg):-- git clone https://github.com/tibbe/ekg.git-+[GitHub issue tracker](https://github.com/l0negamer/ekg/issues). -# Authors+Master [git repository](https://github.com/l0negamer/ekg): -This library is written and maintained by Johan Tibell,-<johan.tibell@gmail.com>.+ git clone https://github.com/l0negamer/ekg.git
System/Remote/Monitoring.hs view
@@ -33,7 +33,9 @@ , serverThreadId , serverMetricStore , forkServer+ , forkServerNoHostname , forkServerWith+ , forkServerNoHostnameWith -- * Defining metrics -- $userdefined@@ -205,8 +207,20 @@ forkServer host port = do store <- Metrics.newStore Metrics.registerGcMetrics store- forkServerWith store host port+ forkServerMaybeHostnameWith store (Just host) port +-- | Create a server with prefined metrics from+-- 'System.Metrics.registerGcMetrics', listening on all interfaces.+-- If you are running EKG on a private network (including virtual+-- private network), it may be appropriate to bind to all interfaces,+-- not only localhost.+forkServerNoHostname :: Int -- ^ Port to listen on (e.g. 8000)+ -> IO Server+forkServerNoHostname port = do+ store <- Metrics.newStore+ Metrics.registerGcMetrics store+ forkServerMaybeHostnameWith store Nothing port+ -- | Start an HTTP server in a new thread. The server replies to GET -- requests to the given host and port. The host argument can be -- either a numeric network address (dotted quad for IPv4,@@ -230,7 +244,23 @@ -> S.ByteString -- ^ Host to listen on (e.g. \"localhost\") -> Int -- ^ Port to listen on (e.g. 8000) -> IO Server-forkServerWith store host port = do+forkServerWith store host port =+ forkServerMaybeHostnameWith store (Just host) port++-- | Start an HTTP server in a new thread, with the specified metrics+-- store, listening on all interfaces. Other than accepting requests+-- to any hostname, this is the same as `forkServerWith`.+forkServerNoHostnameWith :: Metrics.Store -- ^ Metric store+ -> Int -- ^ Port to listen on (e.g. 8000)+ -> IO Server+forkServerNoHostnameWith store port =+ forkServerMaybeHostnameWith store Nothing port++forkServerMaybeHostnameWith :: Metrics.Store -- ^ Metric store+ -> Maybe S.ByteString -- ^ Host to listen on (e.g. \"localhost\")+ -> Int -- ^ Port to listen on (e.g. 8000)+ -> IO Server+forkServerMaybeHostnameWith store host port = do Metrics.registerCounter "ekg.server_timestamp_ms" getTimeMs store me <- myThreadId tid <- withSocketsDo $ forkFinally (startServer store host port) $ \ r ->
System/Remote/Snap.hs view
@@ -49,20 +49,23 @@ userError $ "unsupported address: " ++ S8.unpack host startServer :: Store- -> S.ByteString -- ^ Host to listen on (e.g. \"localhost\")+ -> Maybe S.ByteString -- ^ Host to listen on (e.g. \"localhost\") -> Int -- ^ Port to listen on (e.g. 8000) -> IO ()-startServer store host port = do+startServer store m_host port = do -- Snap doesn't allow for non-numeric host names in -- 'Snap.setBind'. We work around that limitation by converting a -- possible non-numeric host name to a numeric address.- numericHost <- getNumericHostAddress host+ setBind <- case m_host of+ Just host -> do+ numericHost <- getNumericHostAddress host+ return $ Config.setHostname host . Config.setBind numericHost+ Nothing -> return id let conf = Config.setVerbose False $ Config.setErrorLog Config.ConfigNoLog $ Config.setAccessLog Config.ConfigNoLog $ Config.setPort port $- Config.setHostname host $- Config.setBind numericHost $+ setBind $ Config.defaultConfig httpServe conf (monitor store)
ekg.cabal view
@@ -1,31 +1,57 @@-name: ekg-version: 0.4.0.15-cabal-version: >= 1.8-synopsis: Remote monitoring of processes+name: ekg+version: 0.4.1.0+cabal-version: >=1.10+synopsis: Remote monitoring of processes description: This library lets you remotely monitor a running process over HTTP. It provides a simple way to integrate a monitoring server into any application.-homepage: https://github.com/tibbe/ekg-bug-reports: https://github.com/tibbe/ekg/issues-license: BSD3-license-file: LICENSE-author: Johan Tibell-maintainer: Johan Tibell <johan.tibell@gmail.com>,- Mikhail Glushenkov <mikhail.glushenkov@gmail.com>-category: System, Network-build-type: Simple-data-files: assets/index.html assets/monitor.js assets/monitor.css- assets/jquery.flot.min.js assets/jquery-1.6.4.min.js- assets/bootstrap-1.4.0.min.css- assets/chart_line_add.png assets/cross.png-extra-source-files: LICENSE.icons LICENSE.javascript README.md- assets/jquery-1.6.4.js assets/jquery.flot.js- assets/bootstrap-1.4.0.css- examples/Basic.hs CHANGES.md-tested-with: GHC == 8.4.1, GHC == 8.2.2, GHC == 8.0.2,- GHC == 7.10.3, GHC == 7.8.4, GHC == 7.6.3 +homepage: https://github.com/l0negamer/ekg+bug-reports: https://github.com/l0negamer/ekg/issues+license: BSD3+license-file: LICENSE+author: Johan Tibell+maintainer:+ Johan Tibell <johan.tibell@gmail.com>,+ Mikhail Glushenkov <mikhail.glushenkov@gmail.com>++category: System, Network+build-type: Simple+data-files:+ assets/bootstrap-1.4.0.min.css+ assets/chart_line_add.png+ assets/cross.png+ assets/index.html+ assets/jquery-1.6.4.min.js+ assets/jquery.flot.min.js+ assets/monitor.css+ assets/monitor.js++extra-source-files:+ assets/bootstrap-1.4.0.css+ assets/jquery-1.6.4.js+ assets/jquery.flot.js+ CHANGES.md+ examples/Basic.hs+ LICENSE.icons+ LICENSE.javascript+ README.md++tested-with:+ GHC ==8.0.2+ || ==8.2.2+ || ==8.4.4+ || ==8.6.5+ || ==8.8.3+ || ==8.10.7+ || ==9.0.2+ || ==9.2.8+ || ==9.4.8+ || ==9.6.4+ || ==9.6.6+ || ==9.8.2+ library exposed-modules: System.Remote.Counter@@ -39,22 +65,23 @@ System.Remote.Snap build-depends:- aeson >= 0.4 && < 1.3,- base >= 4.5 && < 4.12,- bytestring < 1.0,- ekg-core >= 0.1 && < 0.2,- ekg-json >= 0.1 && < 0.2,- filepath < 1.5,- network < 2.7,- snap-core < 1.1,- snap-server < 1.2,- text < 1.3,- time < 1.9,- transformers < 0.6,- unordered-containers < 0.3+ aeson >=0.4 && <1.6 || >=2.0 && <2.3+ , base >=4.5 && <4.20+ , bytestring <1.0+ , ekg-core >=0.1 && <0.2+ , ekg-json >=0.1 && <0.2+ , filepath <1.5+ , network <3.3+ , snap-core <1.1+ , snap-server <1.2+ , text <2.2+ , time <1.13+ , transformers <0.7+ , unordered-containers <0.3 - ghc-options: -Wall+ ghc-options: -Wall+ default-language: Haskell2010 source-repository head type: git- location: https://github.com/tibbe/ekg.git+ location: https://github.com/l0negamer/ekg.git