Skip to content

About

Prometheus.io Common Lisp client

Topics

Resources

Stars

91 stars

Watchers

7 watching

Forks

Latest commit

 

History

194 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prometheus.io Common Lisp Client CI

Tested on SBCL and CCL.

Example Grafana dashboard for Hunchentoot on SBCL:

Prometheus + Grafan + SBCL + Hunchentoot

You can get this dashboard here.

Example Quick Start

Example uses the Linux process collector, plus the SBCL collectors on SBCL.

(ql:quickload :prometheus.examples)
(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, CKMS via quantile-estimator)
  • Quantile Summary (DDSketch: relative-error quantiles, mergeable across series, sharded per CPU; port of prometheus.erl's prometheus_quantile_summary)

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

Hot paths allocate nothing and use no CLOS. Resolve a series once and keep it - this skips the label lookup:

(defvar *requests* (prom:get-metric requests-counter '("get")))
(prom:counter.inc *requests*)

Counters, histograms and quantile summaries are sharded per CPU, so threads on different CPUs do not contend. Label lookups are lock-free.

SBCL 2.6.10, 4 CPUs, 32 threads, million ops/s:

0.4 now
counter.inc on a series 4.2 55.6
counter.inc with labels 1.6 26.3
gauge.set on a series, 1 thread, ns/op 59.6 8.0
histogram.observe on a series 2.5 50.0
summary observe (CKMS -> DDSketch) 0.3 19.2

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

About

Prometheus.io Common Lisp client

Topics

Resources

Stars

91 stars

Watchers

7 watching

Forks

Releases

Packages

Used by

Contributors

Languages