Commit Graph

267 Commits

Author SHA1 Message Date
Jimmi Dyson
40f908db04 Fix machine ID file path when running in container
Fixes #955
2015-12-02 08:51:48 +00:00
Lei Xue
dbbe38dfed re-order the import package 2015-11-30 16:43:22 +08:00
Jimmi Dyson
1f679cee70 Clean up unused struct fields (via structcheck linter) 2015-11-27 22:06:16 +00:00
Jimmi Dyson
b9ff5c098c Fix up ignored/inefficient assigns (via ineffassign linter) 2015-11-27 22:01:54 +00:00
Jimmi Dyson
f9eb56e800 Merge pull request #966 from afein/godep_update_runc
[Godeps] changed docker/libcontainer dependency to runc/libcontainer
2015-11-26 15:19:28 +00:00
Jimmi Dyson
d1fce20304 Regexp tidy up 2015-11-26 09:14:26 +00:00
Alex Mavrogiannis
4533dd7d18 changed libcontainer dependency to runc 2015-11-21 14:04:01 -08:00
Jimmi Dyson
68db03188f Don't bail out if docker is unreachable - recover when back up 2015-10-23 12:58:44 +01:00
Jimmi Dyson
b8b6e1bac1 Support devicemapper storage for docker images dir
Fixes #920
2015-10-21 09:56:33 +01:00
Jimmi Dyson
357e6a0f23 Reuse cached docker client
Fixes #925
2015-10-20 20:15:54 +01:00
Jimmi Dyson
cf43fd2556 Expose git revision as well as version in version info, add Makefile 2015-10-02 10:26:33 +01:00
Pavel Tikhomirov
4cbd91c761 Make getCgroupPath work in case of named or multi- hierarchies
In case we have devices hierarchies mounted in named cgroup
or together with other hierarchy regexp parse will fail.
So after "devices" and before ":" can be name of cgroup or
other hierarchies names.

E.g.:
1) remount cgroups:
umount /sys/fs/cgroup/devices
mkdir /sys/fs/cgroup/named_cgroup
mount -n -t cgroup -o devices,name=named_cgroup cgroup
/sys/fs/cgroup/named_cgroup

2) add some task to nested device cgroup and check ps output
mkdir /sys/fs/cgroup/named_cgroup/test.slice
sleep 1000 &
[1] 22734
echo 22734 > /sys/fs/cgroup/named_cgroup/test.slice/tasks
ps -ao pid,cgroup | grep 22734
22734
14:devices,name=named_cgroup:/test.slice,1:name=systemd:/user.slice/user-1000.slice/session-1.scope

Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
2015-09-18 17:55:23 +03: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
Phillip Wittrock
b7bbefd9b1 Always to a live lookup of version info instead of caching. 2015-08-20 16:48:45 -07:00
Miciah Masters
003125975c glog.Warning -> glog.Warningf
Fix two places where glog.Warning is used with a formatted string.
2015-08-19 15:47:36 -04:00
Jin-Hwan Jeong
9bb7a0278d this patch fixes "high cpu consumption without sleeping in housekeeping()" problem if system time has changed
Signed-off-by: Jin-Hwan Jeong <jhjeong.kr@gmail.com>
2015-08-18 09:03:12 +09:00
anushree-n
4c67b21c1d Add Prometheus Collector 2015-08-14 10:59:37 -07:00
anushree-n
04a78502ca Modify generic collector 2015-08-12 17:56:01 -07:00
Rohit Jnagal
15664a6a0c Fix cgroup name parsing logic in ps output for centos6.
Centos 6 uses a different ps lib resulting in different output.
2015-08-08 02:23:58 +00:00
Rohit Jnagal
ef41402a39 Merge pull request #838 from rjnagal/docker
Add custom metrics to spec.
2015-07-27 16:37:32 -07:00
Rohit Jnagal
c0b3f779f5 Add custom metrics to spec.
Remove spec-related fields from stat.
We can simplify the stats a bit further by handling Int and Float better.
But this was big enough change already.
Verified v1 and v2 spec/stats/appmetrics APIs.
2015-07-25 20:17:54 +00:00
Victor Marmol
b581ee2e67 Merge pull request #835 from rjnagal/docker
Fix converion of rss and vsz in ps output.
2015-07-24 10:12:25 -07:00
Rohit Jnagal
a5e65b38c6 Fix converion of rss and vsz in ps output. 2015-07-24 15:35:58 +00:00
Victor Marmol
ca7fd6d40a Merge pull request #831 from rjnagal/docker
Two small fixes to custom metric collection.
2015-07-22 21:34:23 -07:00
Rohit Jnagal
3f8e065947 Two small fixes to custom metric collection.
- a typo in minPollingFrequency multiplies it with time.Second twice.
- Updating custom metrics is unnecessarily called for all containers.
2015-07-23 01:56:07 +00:00
Victor Marmol
17c45c6ec3 Merge pull request #827 from rjnagal/docker
Add logic to read custom metric config files from container root.
2015-07-22 13:39:17 -07: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
Piotr Szczesniak
90ca5f9286 Moved max_housekeeping and allow_dynamic_housekeeping flags to cadvisor.go 2015-07-21 20:26:57 +02:00
anushree-n
e2e193c1fd Add metrics caching 2015-07-20 11:24:20 -07:00
Alex Mavrogiannis
9666c8b38f population of memory limit for the machine container 2015-07-07 14:15:38 -07:00
Ananya Kumar
1abd853d6b Create package cloudinfo 2015-06-19 02:35:08 -04:00
Victor Marmol
675c09e296 Remove stats from cache when container is destroyed 2015-06-10 07:53:46 -07:00
Rohit Jnagal
a4499777c4 Make graceful degradation of OOM events clearer. 2015-06-09 16:45:14 +00:00
Rohit Jnagal
eb8f941ba6 Make process listing work when cadvisor is running in docker.
Use /rootfs/proc to build the process listing.
2015-06-04 18:49:43 +00:00
Rohit Jnagal
1a2781819e Separate in-memory cache from storage drivers. 2015-06-02 16:06:01 +00:00
Rohit Jnagal
e21cab8d43 Add filesystem, diskio, and network to spec. 2015-05-28 18:25:14 +00:00
Rohit Jnagal
0553f6cd16 Merge pull request #730 from bpradipt/ppc64_cpuinfo
Add support for parsing CPU speed from /proc/cpuinfo on Power (ppc64) systems
2015-05-27 22:24:23 -07:00
Pradipta Kumar
e6de0dd8aa Add support for parsing CPU speed from /proc/cpuinfo on Power (ppc64) systems.
/proc/cpuinfo format varies between architectures. For example

On Intel the cpu speed is shown like the following
cpu MHz		: 3000

whereas on Power systems its shown like the following
clock		: 3000MHz

This patch enables support for /proc/cpuinfo parsing on Power systems

Signed-off-by: Pradipta Kr. Banerjee <bpradip@in.ibm.com>
2015-05-22 10:31:37 +05:30
Victor Marmol
080f8a9592 Add managed containers to debug output 2015-05-21 15:18:49 -07:00
Victor Marmol
0525d40a4a Add DebugInfo() API and put the information on /validate 2015-05-21 14:46:35 -07:00
Rohit Jnagal
d8fb3c802f Add cgroup info and links to the process list on root page. 2015-05-20 03:19:56 +00:00
Rohit Jnagal
1ca29f8f20 Improve process table output.
Use pretty prints, but maintain sorting capabilities.
2015-05-19 16:33:56 +00:00
Victor Marmol
dd6663b42b Register factories in Start() instead of New().
This will allow for delayed registration for client users (e.g.: Kubelet).
2015-05-15 09:14:40 -07:00
Victor Marmol
64361d198a Merge pull request #712 from rjnagal/summary
Add manager methods to get docker status and images.
2015-05-13 15:23:29 -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
Victor Marmol
45a0cc2dc7 Merge pull request #710 from rjnagal/summary
Add memory-percent to ps output.
2015-05-12 15:51:31 -07:00
Rohit Jnagal
3bcae7f430 Add memory-percent to ps output. 2015-05-12 22:44:48 +00:00
Victor Marmol
9535dd21e2 Merge pull request #709 from rjnagal/summary
Add process information to the UI.
2015-05-12 13:27:26 -07:00
Rohit Jnagal
2a99748874 Add process information to the UI.
For root, we report all processes. Process stats are refreshed every minute.
2015-05-12 19:08:12 +00:00
Rohit Jnagal
828da56a01 Add 'Available' to storage API. 2015-05-12 06:56:45 +00:00
Victor Marmol
d61a381e84 Merge pull request #707 from rjnagal/docker
Add an api to support ps/top.
2015-05-11 23:01:24 -07:00
Rohit Jnagal
5e10989a78 Add an api to support ps/top. 2015-05-12 00:06:47 +00:00
Victor Marmol
4fdd709717 Collectors export metrics from Collect(). 2015-05-11 12:26:51 -07:00
Victor Marmol
832c6e94c3 Merge pull request #698 from rjnagal/docker
Return partial topology information if cache info is not available.
2015-05-07 14:42:58 -07:00
Rohit Jnagal
265dbeb852 Return partial topology information if cache info is not available.
Everything other than cache information is available through /proc/cpuinfo.
2015-05-07 21:11:21 +00:00
Victor Marmol
834d1cf34e Lower logging level of some common logs. 2015-05-06 10:24:50 -07:00
Rohit Jnagal
3b13df3c6c Remove spec info from container creation event data. 2015-05-05 22:14:15 +00:00
Rohit Jnagal
6bcb4aa394 Merge pull request #678 from vmarmol/collector
Add Collector executor support
2015-05-05 10:09:52 -07:00
Victor Marmol
bce54ce3f5 Run custom collectors in container housekeeping.
This will allow us to register and run custom collectors for each
container.
2015-05-04 15:57:18 -07:00
Rohit Jnagal
5fcad323ca Publish creation event for pre-existing containers on start-up. 2015-05-04 18:37:43 +00:00
Victor Marmol
a7a7aacebc Add flags to customize the events StoragePolicy. 2015-05-01 12:04:11 -07:00
Victor Marmol
28dfea761c Add events StoragePolicy. 2015-05-01 10:42:17 -07:00
Victor Marmol
1c25746cf0 Limit events to 100,000 of each type.
This gives us a bit over one event per second for one day. Assuming 250
bytes per event, the max memory usage is ~24MiB per event type.
2015-05-01 00:03:41 -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
62d670d386 Limit the number of events stored to 24h.
There is a TODO to make this configurable.
2015-04-25 18:04:52 -07:00
Victor Marmol
5fd8273806 Allow customizing storage duration. 2015-04-22 09:43:30 -07:00
Rohit Jnagal
64b105db5a Make cpu load reader flag controlled. 2015-04-15 23:37:36 +00:00
Victor Marmol
fd1ff04f7f Split OOM event into OOM and OOM Kill.
This will allow to watch and differentiate that the OOM victim may not
equal the OOM'd container.
2015-04-15 13:30:08 -07:00
Katie Knister
00ce5ca367 Reenable netlink cpu tracking 2015-04-14 14:07:19 -07:00
Victor Marmol
11462d80bc Lowering log levels.
Reduce common logging using Kubernetes logging standards.
2015-04-13 15:05:41 -07:00
Katie Knister
ee4bdc2698 Improvements to events integration test 2015-04-10 13:33:22 -07:00
Victor Marmol
a21bf2555e Make EventData a concrete type.
Having this as an interface was giving us a lot of problems with
unmarshaling. Made into a union of concrete types.
2015-04-09 15:21:24 -07:00
Justin Santa Barbara
95e4953239 Simple fix to format string 2015-04-07 08:32:57 -07:00
Victor Marmol
4cb69036f8 Move Event to info since it is a public API object. 2015-04-01 09:17:43 -07:00
Rohit Jnagal
d1f21bb2fd Merge pull request #600 from kateknister/apiBranch
adding systemd oomparser functionality
2015-03-25 23:06:00 -07:00
Katie Knister
3c7e67991d Created a way to remove unused channels from an eventHandler's watchers list 2015-03-25 16:36:48 -07:00
Katie Knister
21e96ed61c adding systemd oomparser functionality 2015-03-24 12:33:57 -07:00
Federico Simoncelli
9d41787b62 machine: collect node boot id if available
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
2015-03-23 10:45:03 -04:00
Clayton Coleman
3e7c1b3613 Reduce the level for a few common log messages
Following the Kubernetes convention of V(2) is normal verbosity (log
each request to a webserver).
2015-03-19 23:55:36 -04:00
Rohit Jnagal
6db3717426 Add recursive and type options (raw/docker) to spec and summary endpoints.
spec, stats, and summary now all support the same options (except count,
which is only parsed for stats).
2015-03-18 18:44:59 +00:00
Victor Marmol
67f6ee48f9 Return unique containers in Subcontainers().
Before this we'd return an instance for each alias we'd saved.

Fixes #592.
2015-03-15 09:58:04 -07:00
Vish Kannan
588b1498ac Merge pull request #587 from rjnagal/docker
Add alias and namespace information to /spec endpoint
2015-03-13 14:22:56 -07:00
Rohit Jnagal
53d25cc90e Add alias and namespace information to /spec endpoint 2015-03-13 21:13:23 +00:00
Victor Marmol
aa8697140d Don't fail fetching machine information when not available 2015-03-12 14:48:12 -07: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
Victor Marmol
5eeb6fdd40 Merge pull request #574 from kateknister/master
Fixed some bugs in oomparser streaming
2015-03-11 09:14:07 -07:00
Victor Marmol
8ae06b5c3d Merge pull request #573 from rjnagal/docker
Add /storage endpoint to 2.0 API.
2015-03-10 21:48:51 -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
Katie Knister
78f3029943 Fixed some bugs in oomparser streaming 2015-03-10 18:18:54 -07:00
Victor Marmol
c593620f47 Don't fail if the raw cgroup factory fails to register.
This will allow us to degrade gracefully in the environments where no
cgroups exist, but we'd still like cAdvisor to be running.
2015-03-10 15:41:15 -07:00
Victor Marmol
853f2d9bad Don't fail requests if System UUID is not available.
We won't have access to it if we're not running as root.
2015-03-09 18:22:08 -07:00
Victor Marmol
54bc33dd2c Lowering log level for frequent events.
Lowering all frequent normal logs to v=3. Kubelet runs by default on
debug of v=2 and we don't want to log these events in that case.
2015-03-09 14:53:53 -07:00
Rohit Jnagal
6dcae1221f Make machine-id sources flag a comma-separated list.
Use "/etc/machine-id,/var/lib/dbus/machine-id" as default.
2015-03-05 16:52:24 +00:00
Rohit Jnagal
d3db8503f4 Move derived stats to v2. Add v2 container spec. 2015-03-04 18:27:57 +00:00
Victor Marmol
7839dd8eef Merge pull request #560 from simon3z/master
Add system uuid and machine id information
2015-03-04 09:42:41 -08:00
Katie Knister
6ffb8454b0 Added container event monitoring 2015-03-03 18:14:36 -08: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
Victor Marmol
c1959cebee Add ManagerMock. 2015-03-03 11:28:33 -08:00