The use case for GoProMetrics is to provide an aggregator and metrics cache for ephemeral processes. Such as scripting languages like PHP. GoProMetrics is simple, lightweight, fast and provides an easy to use API over HTTP.
PHP Client: https://github.com/jtl-software/goprometrics-client
- Support for Counter metrics
- Support for Gauge metrics
- Support for Histogram metrics
- Support for Summary metrics
- Each metric can be described using Namespace, Labels and Help Text
- Provide
/metricsendpoint for scraping
go build
// run it
./goprometrics
./goprometrics -h
Usage of ./goprometrics:
-host string
Api Host (default "127.0.0.1")
-hostm string
Host to expose metrics (default "127.0.0.1")
-port string
Api Port (default "9111")
-portm string
Port to expose metrics (default "9112")
docker pull jtlsoftware/goprometrics
docker run -it -p 9111:9111 -p 9112:9112 jtlsoftware/goprometrics
docker-compose up -d
Will start GoProMetrics listening on :9111 (api) and :9112 (to expose metrics). There is also a prometheus up and running on :9090.
Need some logs? docker-compose logs -f goprometrics
Push and increment a counter
curl -XPUT '127.0.0.1:9111/count/foobar/drinks' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'labels=alcoholic:beer'
Expose Metrics
curl '127.0.0.1:9112/metrics'
See example directory for Example requests
