Commit Graph

204 Commits

Author SHA1 Message Date
Jimmi Dyson
b8fc8cd2ae Add container specs & cadvisor version info to prometheus metrics 2015-09-09 14:28:54 +01:00
Jimmi Dyson
7e10398a50 Use proc fs to get network stats.
Reasons discussed in
https://github.com/google/cadvisor/issues/822#issuecomment-135811901 &
following.
2015-08-29 00:20:07 +01:00
Jimmi Dyson
ff0796712b Add image name to container spec & prometheus metrics
Fixes #848
2015-08-28 12:38:16 +01:00
Jimmi Dyson
d5fa97c998 Get network stats by switching network namespace on newer Docker
versions.

Fixes #822
2015-08-25 23:27:01 +01:00
Rohit Jnagal
7a2f508b50 Fix network info for docker containers running with --net=host.
Docker still reports a loop device for these. Need to check for
more than one device to mark network as available.
2015-08-24 02:58:03 +00:00
Rohit Jnagal
a123fd72d8 Add logic to read custom metric config files from container root.
Docker does not provide the rootfs path through docker inspect or statefile
and the path is dependent on the storage driver being used.

Instead of enumerating the storage drivers, we pick a pid from the container
and get the config from /proc/pid/root. Although a bit expensive, this method
works for non-docker containers too.
2015-07-22 15:45:07 +00:00
Victor Marmol
4a9a57cdd0 Merge pull request #814 from anushree-n/typo
Fix typo
2015-07-13 10:41:01 -07:00
anushree-n
fff8880a8d Typo in helpers.go 2015-07-13 10:30:46 -07:00
anushree-n
ddfe10af54 Rename compatability.go to compatibility.go 2015-07-13 10:29:36 -07:00
Alex Mavrogiannis
9666c8b38f population of memory limit for the machine container 2015-07-07 14:15:38 -07:00
Victor Marmol
fc62b8c384 Copy stats before we convert them.
Fix # 782
2015-06-25 11:30:36 -07:00
Ananya Kumar
aaad776d5d 1 line fix for net host bug 2015-06-10 11:00:49 -07:00
Victor Marmol
72df0cb098 Send data for all interfaces for raw containers 2015-06-08 09:58:47 -07:00
Victor Marmol
b923eff11c Expose multiple network interfaces in API.
Part of #686
2015-06-07 17:01:53 -07:00
Victor Marmol
53bcd977b5 Detect systemd with cgroup hierarchy.
The previous approach was brittle from within a container and was inconsistend.

Fixes #666
2015-06-02 13:11:46 -07:00
Victor Marmol
0525d40a4a Add DebugInfo() API and put the information on /validate 2015-05-21 14:46:35 -07:00
Victor Marmol
1f248ee956 Add inotify watches as debug information 2015-05-21 14:40:49 -07:00
Victor Marmol
392e1be9e5 Use one InotifyWatcher 2015-05-21 14:40:49 -07:00
Victor Marmol
ab032efda9 Report the last cgroup destroy event. 2015-05-21 10:11:09 -07:00
Victor Marmol
36a6e68169 Separate inotify handling into its own object.
This makes it easier to ensure the error conditions are handled well and
that we don't leak watches.

Fixes #703
2015-05-21 08:36:47 -07:00
Rohit Jnagal
379e5aac57 Add manager methods to get docker status and images.
This is only meant to populate /docker UI page.
2015-05-13 22:07:09 +00:00
Rohit Jnagal
5e10989a78 Add an api to support ps/top. 2015-05-12 00:06:47 +00:00
Victor Marmol
86dd6cc99d Merge pull request #706 from rjnagal/docker
Add 'bytes available' to fs info.
2015-05-11 15:12:37 -07:00
Rohit Jnagal
e43ada2e00 Add 'bytes available' to fs info.
The current capacity and usage numbers are insufficient to figure out
actual bytes available for a non-root user for the fs. Available is the
value used by df and the one we need to track to detect low diskspace
condition.
2015-05-11 19:27:40 +00:00
Victor Marmol
757ad9e1ae WorkingSet should use inactive file 2015-05-11 09:49:29 -07:00
Victor Marmol
8928d487de Min working set should be 0.
Fixes #685
2015-05-11 09:49:23 -07:00
Rohit Jnagal
4b4312b290 Improve approximation of container creation time.
Containers with subcontainers always report creation time to be same as the time
of creation of the latest subcontainer.

Still not an ideal solution, but accurate for most practical purposes.
2015-05-07 18:14:54 +00:00
Victor Marmol
1a1a1faa7e Update inotify dependency. 2015-05-04 10:15:21 -07:00
Victor Marmol
a7a7aacebc Add flags to customize the events StoragePolicy. 2015-05-01 12:04:11 -07:00
Victor Marmol
1e09f9012d Adding container labels 2015-04-30 23:09:03 -07:00
Rohit Jnagal
d0424eca0f Add --docker_only flag to enable tracking for only docker containers and root.
This reduces unnecessary load on the system and also cleans up the UI clutter.
Currently defaulted to false.
2015-04-30 23:34:44 +00:00
Victor Marmol
11462d80bc Lowering log levels.
Reduce common logging using Kubernetes logging standards.
2015-04-13 15:05:41 -07:00
Rohit Jnagal
dfcc05a953 Fix networking stats by switching Tx and Rx stats.
A better fix is to directly use stats collected by libcontainer.
2015-04-13 17:01:06 +00:00
Victor Marmol
64c0d3d8c3 Migrating cAdvisor to new libcontainer.
Backwards compatability is maintained with older versions of
libcontainer.
2015-04-10 14:51:29 -07:00
Victor Marmol
e97e203d76 Adding translation layer for pre-API libcontainer configs. 2015-04-10 14:51:29 -07:00
Clayton Coleman
9ce178f707 Lazily init DBus only when it is needed
OpenShift has some cAdvisor packages in its import chain. The init() here
invokes Dbus start even when cAdvisor is not actively running or being
used (in our packages).  This change makes the systemd check and dbus
initialization and connection lazy, occuring only the first time someone
invokes UseSystemd().
2015-03-19 16:35:48 -04:00
Rohit Jnagal
e685067a04 Merge pull request #579 from vmarmol/master
Start() exits gracefully when there are no factories.
2015-03-11 23:24:16 -07:00
Victor Marmol
ffdb6f5c7d Start() exits gracefully when there are no factories.
This allows us to handle the case where there are no factories as
happens when testing in a non-container environment. We will still serve
the machine information that is available.
2015-03-11 21:22:16 -07:00
Rohit Jnagal
a0a419614f Add /storage endpoint to 2.0 API.
/storage returns {device, mountpoint, capacity, usage} for all filesystems.
In addition, it also detect and applies label for each filesystem - currently two - "root", "docker-images".

/storage/<label> returns info about the filesystem with specific label. eg. /storage/root returns info for root filesystem.
2015-03-11 01:49:58 +00:00
Rohit Jnagal
872546ba3a Bulk move current info api to info/v1. Making room for info/v2. 2015-03-04 00:47:28 +00:00
Rohit Jnagal
e09f9684e6 Fix cpuset returned in spec on a single core machine.
Switch from "0-0" to "0".
2015-02-19 18:54:23 +00:00
Victor Marmol
131a0c21ea Detect Docker containers by asking the Docker.
No longer do deduction from the cgroup path (only to get the Docker
container ID).

Fixes #450.
2015-02-06 09:15:59 -08:00
Victor Marmol
45ba276ae8 Add container creation time to ContainerSpec. 2015-02-05 09:52:10 -08:00
Victor Marmol
86238d0179 Allow partial success of GetStats().
This should make us more robust in the face of failure (at the cost of
making the failures less prominent). We allow GetStats() to return an
error and a partial result. We will process the result and report the
error.

Fixes #306.
2015-02-03 15:26:31 -08:00
Victor Marmol
01b456c129 Fix detection of AUFS layers.
We were using the container name instead of the Docker ID which breaks
in systemd systems.

Fixes #475.
2015-02-03 10:06:19 -08:00
Vishnu Kannan
aedf42ba8c Adding 'HasDiskIo' to Container Spec to indicate if diskio stats are available for a given container. 2015-01-20 05:06:57 +00:00
Arkadi Shishlov
fe7df00aec Add blkio cgroup to list of supported subsystems 2015-01-17 17:09:35 +02:00
Victor Marmol
909fa133e1 Merge pull request #445 from rjnagal/docker
Add task load stats to containers.
2015-01-16 16:00:50 -08:00
Rohit Jnagal
cbdd96a554 Add task load stats to containers.
The stats are only populated when cAdvisor is running outside network namespaces.
We'll add a different backend to retrieve the same data from within namespaces.
2015-01-16 23:25:22 +00:00
Rohit Jnagal
ed155019ac Verify and fix error message nit :) 2015-01-14 01:15:13 +00:00