Prometheus.io Common Lisp client
Common Lisp
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
benchmark
dashboards
examples
src
t
.gitignore
.travis.yml
README.md
TODO.org
prometheus.asd
prometheus.collectors.process.asd
prometheus.collectors.process.test.asd
prometheus.collectors.sbcl.asd
prometheus.collectors.sbcl.test.asd
prometheus.examples.asd
prometheus.exposers.hunchentoot.asd
prometheus.exposers.hunchentoot.test.asd
prometheus.formats.text.asd
prometheus.formats.text.test.asd
prometheus.pushgateway.asd
prometheus.pushgateway.test.asd
prometheus.test.all.asd
prometheus.test.asd
prometheus.test.support.asd

README.md

Prometheus.io Common Lisp Client Build Status Coverage Status

Example Grafana dashboard for Hunchentoot on SBCL:

Prometheus + Grafan + SBCL + Hunchentoot

You can get this dashboard here.

NOTE: Quantile estimator system used by summary is yet to be included in Quicklisp. Please download manually: https://github.com/deadtrickster/quantile-estimator.cl

Example Quick Start

Currently example uses Linux and SBCL specific collectors.

(ql:quickload :prometheus.example)
(prometheus.example:run)

You can override app/exporter host/port in prometheus.example:run arguments. To stop example app call prometheus.example:stop

Metric Types

  • Counter
  • Int Counter (can only work with unsigned int64)
  • Gauge
  • Histogram
  • Simple Summary (without quantiles)
  • Summary (with quantiles)

Custom collectors

SBCL runtime information

  • Threads
  • Memory

Process information

  • Open fds count
  • Max fds count
  • Virtual memory bytes
  • Resident memory bytes
  • Process CPU seconds{stime|utime} (total)
  • Process start time (Unix epoch)
  • Process uptime

Linux? only

Performance / Optimization

Counter

On SBCL counter can use CAS. On SBCL int counter can use atomic-incf.

Benchmark (30 threads each doing 100000 counter.inc):

Method Avg inc n/s
Mutex 7885
CAS (SBCL) 1902
ATOMIC (SBCL) 141

Gauge

On SBCL gauge can use CAS.

Benchmark (30 threads each doing 100000 gauge.set):

Method Avg set n/s
Mutex 9618
CAS (SBCL) 2204

Exposers

Hunchentoot

Example

Hunchentoot exposer plus SBCL metrics.

(prom.sbcl:make-memory-collector)
(prom.sbcl:make-threads-collector)
(defclass my-acceptor (prom.tbnl::hunchentoot-exposer tbnl:acceptor)
  ())
(tbnl:start (make-instance 'my-acceptor :address "172.17.0.1" :port 9101))

will produce something like this:

SBCL Dashboard

Effect of (sb-ext:gc) can be seen clearly.

License

MIT