prometheus: Prometheus Haskell Client
- Prometheus Haskell Client
A simple and modern, type safe, idiomatic Haskell client for Prometheus monitoring. Specifically there is no use of unsafe IO or manual ByteString construction from lists of bytes. Batteries-included web server.
- Usage Example
module Example where
import System.Metrics.Prometheus.GlobalRegistry
import System.Metrics.Prometheus.Http
import System.Metrics.Prometheus.Metric.Counter (inc)
import System.Metrics.Prometheus.MetricId
main :: IO ()
main = do
globalRegistry <- new
-- Labels can be defined as lists or added to an empty label set
connectSuccessGauge <- registerGauge "example_connections" (fromList [("login", "success")]) globalRegistry
connectFailureGauge <- registerGauge "example_connections" (addLabel "login" "failure" mempty) globalRegistry
connectCounter <- registerCounter "example_connection_total" mempty globalRegistry
latencyHistogram <- registerHistogram "example_round_trip_latency_ms" mempty [10, 20..100] globalRegistry
inc connectCounter -- increment a counter
-- [...] pass metric handles to the rest of the app
serveHttpTextMetrics 8080 globalRegistry -- http://localhost:8080/metric server
- Advanced Usage
A Registry and StateT-based RegistryT are available for unit testing or generating lists
of `[IO a]` actions that can be sequenced and returned from pure code to be applied.
[Skip to Readme]
Modules
[Index]
Downloads
- prometheus-0.2.0.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0.0, 0.1.0.1, 0.1.0.2, 0.1.0.3, 0.1.1, 0.2.0, 0.3.0, 0.3.1, 0.3.2, 0.3.2.1, 0.4.0, 0.4.1, 0.4.2, 0.5.0, 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.3.0 |
|---|---|
| Dependencies | atomic-primops (>=0.8 && <0.9), base (>=4.8 && <5), bytestring (>=0.10 && <0.11), containers (>=0.5 && <0.6), http-types (>=0.9 && <0.10), mtl (>=2.2 && <2.3), text (>=1.2 && <1.3), transformers (>=0.4 && <0.5), wai (>=3.2 && <3.3), warp (>=3.2 && <3.3) [details] |
| License | BSD-3-Clause |
| Copyright | All Rights Reserved |
| Author | Luke Hoersten |
| Maintainer | luke@hoersten.org |
| Uploaded | by LukeHoersten at 2016-03-21T23:43:04Z |
| Revised | Revision 1 made by HerbertValerioRiedel at 2019-02-06T12:30:00Z |
| Category | Metrics, Monitoring, Web, System |
| Home page | http://github.com/LukeHoersten/prometheus#readme |
| Bug tracker | http://github.com/LukeHoersten/prometheus/issues |
| Source repo | head: git clone https://github.com/LukeHoersten/prometheus |
| Distributions | LTSHaskell:2.3.0, NixOS:2.3.0, Stackage:2.3.0 |
| Reverse Dependencies | 6 direct, 1 indirect [details] |
| Downloads | 25352 total (84 in the last 30 days) |
| Rating | 2.25 (votes: 2) [estimated by Bayesian average] |
| Your Rating | |
| Status | Docs available [build log] Last success reported on 2016-03-21 [all 1 reports] |