samstarling / finagle-prometheus

Provides a bridge between Finagle and Prometheus metrics
https://samstarling.co.uk/projects/finagle-prometheus/
MIT License
30 stars 18 forks source link

Is using a CollectorRegistry really necessary? #27

Closed caplan closed 6 years ago

caplan commented 6 years ago

Just curious - in theory would it be possible to have a MetricsService that pulls data straight from the twitter MetricsView? You'd have to write a custom formatter rather than using TextFormat.write004(), but on the plus side you could completely get rid of PrometheusStatsReceiver...

samstarling commented 6 years ago

Hey @caplan! That's a good question. I haven't come across MetricsView, I have to admit. Let me have a look: getting rid of the PrometheusStatsReceiver would be good, because that code is a little hairy these days.

I'm on holiday over the weekend, so I might not get much of a chance to look in the next few days, but I'd love to pick this up afterwards, so thanks for raising it.

samstarling commented 6 years ago

At first glance it looks like MetricsView is private.

caplan commented 6 years ago

oh duh, right... I guess twitter doesn't really want to expose aggregated metrics as an api :(

caplan commented 6 years ago

fwiw I opened an issue with finagle

samstarling commented 6 years ago

Hey @caplan: sorry it's been a while. I had a poke around Metrics and (sadly) I didn't find a better way to do things, but you're right: a MetricsView would make my life a lot easier! I'm going to close this for now, but please just let me know if you think I missed something.