No description
Find a file
2020-07-23 20:59:50 +01:00
src Reset and clear implementations for Gauge. 2020-07-23 00:03:53 +01:00
tests Add units to metric names + checks for validity of names. 2019-03-17 20:15:50 +00:00
prometheus.nimble Initial commit. 2019-03-09 11:59:17 +00:00
README.md Update README.md 2020-07-23 20:59:50 +01:00

Prometheus client library for Nim

This is a Nim client library for Prometheus. Features include:

  • Multiple metric types:
    • Counters
    • Gauges
    • Histograms
  • Nim-specific collectors:
    • Async collector (logs statistics about pending futures, timers and callbacks from Nim's async event loop)
    • GC collector (logs heap allocation statistics, compile with -d:nimTypeNames to get granular information about the allocated object types)

Usage

Add this into your .nimble file:

requires "prometheus"

You then need to serve the Prometheus metrics over HTTP, if you're using Jester you can do so by simply:

routes:
  get "/metrics":
    let data = generateLatest()
    resp Http200, {"Content-type": "text/plain"}, data

Testing

Run:

nimble test

License

MIT