-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prometheus metrics for docker registry & haproxy #3916
Comments
For the routers we'd also like to expose tenant metrics so we have a central gathering point. @ramr I would prefer to expose a stats endpoint via prometheus so that we don't have two stat gathering technologies at play. If you think there is something that would work better let me know - raw stats are not as effective and I'd like to correlate service+namespace to the traffic metric. @ncdc on the registry, i think the answer is no but I think we should do so. |
We should be able to use Prometheus relabelling to add service & namespace as labels, as long as we can parse out that info from backed/frontend config. Alternatively it would be quite simple to write a custom bridge to add this metadata in. |
With routers we need to be sensitive to scale - we may have a hundred Any alternative solution will have to be scalable and flexible in a similar On Aug 9, 2015, at 12:21 PM, Jimmi Dyson notifications@github.com wrote: We should be able to use Prometheus relabelling to add service & namespace — |
Correct, the registry doesn't have any Prometheus integration at the moment. It currently has reporting integration points with bugsnag and newrelic. What is needed to add support for Prometheus? What sort of data are you looking for? |
@ncdc Details of how to add Prometheus metrics & expose them are at https://godoc.org/github.com/prometheus/client_golang/prometheus. As for what data, I'm not really sure... Anything that can be used to monitor the performance of the registry - that requires knowledge of the internals of the registry I guess. Stuff like response times, number of images per namespace, storage used, etc sound like good candidates, but as I said anything that could be used to monitor the registry, both for alerting on issues & to build trends over time. |
@jimmidyson ok, we'll want to ultimately turn this into an upstream proposal for docker/distribution. At the very least, we could probably wrap the main app |
@ncdc That sounds like a quick (hopefully easy) win. |
@smarterclayton Here's an example output from Prometheus exporter for HAProxy. There's only one route in there -
During prometheus relabelling when ingesting metrics, we could roll stats up to namespace ( What do you think? Adding the prometheus haproxy_exporter as a sidecar container in the router pod would be simplest, although can also get it remotely if need be. |
Sidecar is a good place to start - because that decouples the router On Mon, Aug 10, 2015 at 3:11 PM, Jimmi Dyson notifications@github.com
Clayton Coleman | Lead Engineer, OpenShift |
Just saw this - bad filter rules!! Yeah given that there maybe different router implementations - exposing the metrics via some standard interface ala prometheus is definitely better. Just fyi, we do expose the stats host/port for haproxy today, so collecting the metrics is easy enough with a prometheus |
Ultimately the router command probably should just be a template. It was Where possible, I would prefer not to have to have code plugins for the On Aug 10, 2015, at 4:33 PM, ramr notifications@github.com wrote: Just saw this - bad filter rules!! Yeah given that there maybe different — |
@ramr Using the stats HAProxy endpoint & Pormetheus haproxy_exporter as sidecar is exactly how I ingested metrics into Pormetheus - worked nicely & allows us to re-label metrics with namespace & service which is nice. I prefer the idea of running the exporter as a sidecar container - for one thing, it allows us to swap/upgrade impls if need be without affecting the core infra router code. Also getting fixes/features into exporters as required (which I'm sure there will be) without vendoring & carrying in infra router is going to be simpler. |
@ramr @smarterclayton Any news on this? I'd like to get this in, but with the current implementation of I could make the addition of the prometheus exporter sidecar optional via a flag (defaulted to true?). Also could only add the sidecar if there's a compatible sidecar for the router Thoughts? |
@jimmidyson - I can only look at it sometime towards the end of next week. But that plan does that sound good - doing it only for the compatible router and a flag to add it in (the default am on the fence about - but true should be ok I think). |
We have metrics for the router now. @ncdc Any thoughts on registry metrics? |
There is already upstream request for providing prometheus metrics. Which was turned down. The upstream prefers to stay metrics backend agnostic and suggests to process registry log which contains all the information needed. Registry's logging framework supports a wide variety of logging sinks. We could use another sidetrack container inside the registry pod to process the log and provide the metrics. Also there are webhooks that could be used to gather metrics. I would have to make a deeper analysis because I'm not sure if it provides all the data needed. Other ideas? |
Using logs sounds fine - might be worth looking at https://github.com/google/mtail? |
Can we easily convert expvar to prometheus? If not, let's just expose a simple prometheus endpoint and collect the metrics we do have. |
Prometheus does have an expvar collector (https://godoc.org/github.com/prometheus/client_golang/prometheus#ExpvarCollector):
I guess we'd need to quantify what slow means & what the impact is. It's a shame we can't do more direct instrumentation of course. |
We could simply have the prometheus expvar collector shim inside of the On Thu, Feb 4, 2016 at 3:17 AM, Jimmi Dyson notifications@github.com
|
Router now has metrics as of v3.6.0-alpha.1. Registry is in the process of getting some. |
registry metrics implemented in #12711 |
Most components expose metrics for ingestion into Prometheus. I'd like to see the same for haproxy & the docker registry.
HAProxy should be simple enough, running a container in the same pod using the Prometheus HAProxy exporter (https://github.com/prometheus/haproxy_exporter/).
Does the docker registry expose prometheus metrics natively?
The text was updated successfully, but these errors were encountered: