EKG: Remote monitoring of running processes over HTTP
This library lets you remotely monitor a running process over HTTP. It provides a simple way to integrate a monitoring server into any application.
Adding monitoring to your application is simple. Just launch the monitoring server as soon as your application starts
import System.Remote.Monitoring main = do forkServer "localhost" 8000 ...
and then visit http://localhost:8000/ in your web browser.
To make full use out of this module you must first enable GC statistics collection in the run-time system. To enable GC statistics collection, either run your program with
or compile it with
The runtime overhead of
-T is very small so it's safe to always
leave it enabled.
The monitoring server also lets you to retrieve the stats as JSON. Simply send the server an HTTP GET request with the Accept header set to "application/json":
curl -H "Accept: application/json" http://localhost:8000/
You can use the JSON API to e.g. write applications that monitor other applications.
Please report bugs via the GitHub issue tracker.
Master git repository:
git clone https://github.com/tibbe/ekg.git
This library is written and maintained by Johan Tibell, .
Support aeson 1.2.
Down throw ThreadKilled exception back to the thread that killed us.
Support aeson 1.0.
GHC 8.0 support.
Move the JSON encoding into a separate ekg-json package.
Support GHC 7.10.
Re-raise exceptions in the server thread in the main thread.
Improve Windows support.
Fix broken example code.
Fix bug where
forkServerWithwould register GC metrics, despite the docs saying that it doesn't.
Fix example code that broke in the package split.
- Support aeson-0.8 and transformers-0.4.
- Include original bootstrap source in tarball.
Fix JS bug which led to type errors for distribution metrics.
Lots of the internals were split off into a new package, ekg-core.
Gauge.modifyfunction was removed, as it can't be supported by the new, more efficient implementation of gauges.
The JSON API was significantly overhauled. The the Haddock documentation for details.
The metric store used internally by the server is now exposed and can be used to share the same metric store between ekg and e.g. ekg-statsd.
It's now possible to provide a custom metric store to the server.
The getDistribution function was added.
The UI now has less special treatment for built-in metrics.
Fixed security issue where ekg would always listen to all incoming requests, even if "localhost" was specified.
Always export partotbytes_copied. Previously it was only exported if using base-4.6 and later.
Support GHC 7.6
Add labels, which are free-form string values exported by the monitoring server. Labels allow you to export e.g. the command line arguments used to start the executable or the host name it's running on.
Change icons to Creative Commons Attribution 3.0 licensed one
Support Snap 0.8
Don't require an internet connection, by serving Bootstrap CSS and jQuery from the monitoring server.
Switch from Blueprint to Bootstrap CSS
Add gauges and change counters to always be monotonically increasing
Add web interface column headers
Reorganize the web interface to show counters and gauges in separate sections
Change REST API to allow separate access to counters and gauges
Return the server time in the JSON response it and use server time instead of client time when graphing
Make it possible to graph user-defined counters and gauges
Format numbers using comma separators
Show a message box when the server can't be reached
Add user-defined counters
Suppress Snap logging to stdio
Add REST-style API for accessing single counters
- First EKG release