trivago / gollum

An n:m message multiplexer written in Go
http://gollum.readthedocs.org/en/latest/
Apache License 2.0
940 stars 74 forks source link

Feature request: Metrics in Prometheus format #221

Closed dkleuser closed 5 years ago

dkleuser commented 6 years ago

Issue description

It would be great if Gollums metrics were also exposed in the format that Prometheus expects.

Context

This would enable us to monitor Gollum with Prometheus.

Possible Solution

There is an official Golang client library for exposing metrics in the required format: https://github.com/prometheus/client_golang As it is the default that Prometheus expects, it would be nice if the metrics were available at the endpoint /prometheus.

Please also see https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels for the allowed characters for metric labels.

arnecls commented 6 years ago

Another solution would be to switch to go-metrics and use their prometheus adapter: https://github.com/deathowl/go-metrics-prometheus

However - we should benchmark go-metrics first as metrics already cause quite an overhead in gollum. Also we must somewhat stay backwards compatible as there are tools around processing gollum metrics ... and we already somewhat broke this with 0.5