{"action":"closed","issue":{"url":"https://api.github.com/repos/google/cadvisor/issues/502","labels_url":"https://api.github.com/repos/google/cadvisor/issues/502/labels{/name}","comments_url":"https://api.github.com/repos/google/cadvisor/issues/502/comments","events_url":"https://api.github.com/repos/google/cadvisor/issues/502/events","html_url":"https://github.com/google/cadvisor/issues/502","id":57170458,"number":502,"title":"Prometheus integration","user":{"login":"beorn7","id":5609886,"avatar_url":"https://avatars.githubusercontent.com/u/5609886?v=3","gravatar_id":"","url":"https://api.github.com/users/beorn7","html_url":"https://github.com/beorn7","followers_url":"https://api.github.com/users/beorn7/followers","following_url":"https://api.github.com/users/beorn7/following{/other_user}","gists_url":"https://api.github.com/users/beorn7/gists{/gist_id}","starred_url":"https://api.github.com/users/beorn7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beorn7/subscriptions","organizations_url":"https://api.github.com/users/beorn7/orgs","repos_url":"https://api.github.com/users/beorn7/repos","events_url":"https://api.github.com/users/beorn7/events{/privacy}","received_events_url":"https://api.github.com/users/beorn7/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-02-10T12:50:02Z","updated_at":"2015-05-05T20:39:01Z","closed_at":"2015-05-05T20:39:01Z","body":"After our VC discussion, I thought I open an issue here to track the options and efforts for Prometheus integration.\r\n\r\nI have looked a bit at the cadvisor code, and it seems to me that it should be relatively easy to (optionally) export a sub-set of metrics directly by the cadvisor binary (via an additional HTTP endpoint) using https://github.com/prometheus/client_golang . The sub-set should be defined by metrics that fit well into the Prometheus data model and are interesting to have available together with metrics from instrumented applications running in the same cluster. Technically, you would probably implement a prometheus.Collector that takes info.ContainerInfo objects and extracts Prometheus metrics from it on scrape time (in the Collect method). I'm happy to assist with questions, or I could provide a prototype implementation. I think, this approach makes more sense than implementing and running a separate binary that scrapes cadvisor's JSON and re-exports it as Prometheus metrics. \r\n\r\nNote that there is https://github.com/docker-infra/container_exporter already, which might serve as a source of inspiration. (Alternatively, one might simply decide to run a container_exporter in addition to cadvisor.)\r\n\r\nI'm a bit lost when trying to figure out which parts of cadvisor are Docker specific, which are general container things, and which are Kubernetes specific. So I can't really judge what the best course of action would be here..."}}