Skip to content

jtl-software/goprometrics

Repository files navigation

GoProMetrics

Test

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

Features

  • 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 /metrics endpoint for scraping

Install - Build it

go build

// run it
./goprometrics

Run it

./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")

Install - Run with Docker

docker pull jtlsoftware/goprometrics
docker run -it -p 9111:9111 -p 9112:9112 jtlsoftware/goprometrics

Install - Run with Docker-Compose

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

Examples

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

About

GoProMetrics is a metric cache for Prometheus.io it can be used as aggregator or distributed counter

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors