Open alexandrejuma opened 6 years ago
It's on our long-term roadmap, but it will require bigger changes / refactor in our service structure so we can accommodate that (each service will need to expose an HTTP interface).
In the mean time you can perhaps use something like this - https://github.com/prometheus/statsd_exporter.
Any update on this ? I think the first thing that could be interesting would be to have a method that generate a proper metrics name with the proper keys (vs what is done currently what fuse all the keys with the metric name and make it hard to get the information back). Once this part is coded it should be quite easy for other people to create metrics adapters to push to Prometheus/InfluxDB, etc...
@kedare i saw that you sub submitted an st2docs PR for configuring Telegraf / InfluxDB. As a quick fix, i wonder if we could use the Telegraf prometheus_client
(https://github.com/influxdata/telegraf/tree/master/plugins/outputs/prometheus_client) plugin to expose metrics for Prometheus?
Indeed I did a PR as workaround using Telegraf :)
I am not sure this is easily doable thru Telegraf for Prometheus as Telegraf has much better support for InfluxDB (they are both part of the TICK stack), also Prometheus doesn't have the concept of fields that InfluxDB has (so we could not reuse the same template rules than the ones for InfluxDB)
However Prometheus has the statsd_exporter that does support this type of mapping: https://github.com/prometheus/statsd_exporter#metric-mapping-and-configuration
Actually I'm working on a blog post (that comes with a short extension to the st2-docs once it's all working as expected) where I'm using the prom/statsd-exporter container to receive the statsd metrics and expose them to be scraped by a prometheus server. First tests look good and this seems to be a "low hanging fruit" when you want to use Prometheus and have a Docker/Kubernetes setup.
Thanks to @winem, there is a dedicated documentation section with configuration example about Pushing metrics to Prometheus via the statsd_exporter
SUMMARY
In #4004 the prometheus api was in scope (for validation) but the discussion went cold somewhere along the way.
This feature request is specifically for the prometheus compatible metrics api
ISSUE TYPE
EXPECTED RESULTS
ACTUAL RESULTS