How can we collect performance metrics from CAdvisor docker container? How can we collect performance metrics from CAdvisor docker container? docker docker

How can we collect performance metrics from CAdvisor docker container?


As other answers mention, cAdvisor doesn't provide its own performance data API, instead it exposes metrics which are typically handled in a separate database if one wants to derive performance data beyond "real time". For example, cAdvisor exports Prometheus metrics natively:

http://prometheus.io/docs/instrumenting/exporters/

The Prometheus metric types:

http://prometheus.io/docs/concepts/metric_types/

Prometheus supports a fairly rich functional expression language that can be used for querying and visualization:

http://prometheus.io/docs/querying/basics/


I think you could use https://github.com/tutumcloud/container-metrics for this. Basically what that would be doing is using influxdb http://influxdb.com/ as a time series data store.

There is some more information available here: http://blog.tutum.co/2014/08/25/panamax-docker-application-template-with-cadvisor-elasticsearch-grafana-and-influxdb/

A couple of people seemed to be looking into the ELK stack (Elastic Search, Logstash, Kibana) for visualising some of this data here: https://github.com/google/cadvisor/issues/634


cAdvisor does provide a rest endpoint to get any stats in real time. By default, it keeps latest two minute of data. You can configure it to keep more or less. It also supports a storage backend to keep dumping stats to an influxdb database.

REST Api:

eg. /api/v1.3/containersdoc: https://github.com/google/cadvisor/blob/master/docs/api.md

Doc on setting up InfluxDB:https://github.com/google/cadvisor/blob/master/docs/influxdb.md