Commit Graph

233 Commits

Author SHA1 Message Date
Vishnu kannan
36415f465a Support opt out for metrics.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-02-24 15:57:31 -08:00
Vish Kannan
eab201fdf5 Merge pull request #1109 from enoodle/cloudinfo_add_aws_and_instance_id
cloudinfo: Adding AWS, Azure support and InstanceID
2016-02-24 13:15:28 -08:00
Erez Freiberger
885649a9b6 cloudinfo: Adding AWS support and InstanceID 2016-02-18 15:28:20 +02:00
Vish Kannan
e9739af184 Merge pull request #1110 from timstclair/httptest
Stop leaking testing dependencies (and flags) in non-testing builds
2016-02-12 14:43:45 -08:00
Tim St. Clair
0bc286dc93 Stop leaking testing dependencies (and flags) in non-testing builds 2016-02-11 13:18:02 -08:00
Marcin Wielgus
fb8efe0cf6 Add a flag to control the number of custom metrics scraped by collectors 2016-02-11 01:33:58 +01:00
Vishnu kannan
ae38e6f460 Update docker dependency.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-01-21 14:57:18 -08:00
Vish Kannan
d80cb88dc0 Merge pull request #1057 from timothysc/housekeeping_jitter
Add jitter to housekeeping interval
2016-01-19 11:04:53 -08:00
Timothy St. Clair
3256647668 Add jitter to housekeeping interval 2016-01-16 08:17:46 -06:00
Vishnu Kannan
944201c86b Refactor api conversion methods. 2016-01-15 15:40:15 -08:00
Jimmi Dyson
4e9d29a408 Fix FS usage goroutine leaks 2016-01-14 19:30:48 +00:00
Tim St. Clair
e011781a88 Add V2 ContainerInfo API
- Add V2 ContainerInfo struct
- Move v1/v2 conversion functions to a reusable package
- Add V2 ContainerInfo accessor method to Manager
2016-01-13 11:58:09 -08:00
Pavel Tikhomirov
97257ccf61 v2: Fix cgroupPathRegExp to match path after first colon after devices
If in getCgroupPath in cgroups we have some other hierarchies after
"devices" using ".*" sometimes will cause matching wrong string as
a container path so we need negated character class here: "[^:]*".

e.g.
If cgroups string is
"153:name=systemd:/system.slice/docker-f55e7cad1fcc02f992e0c33c210ecdc6d641858a665f28370523c27c05bdde0e.scope,4:freezer,devices,name=container:/system.slice/docker-f55e7cad1fcc02f992e0c33c210ecdc6d641858a665f28370523c27c05bdde0e.scope,3:cpuacct,cpu,cpuset,name=fairsched:/system.slice/docker-f55e7cad1fcc02f992e0c33c210ecdc6d641858a665f28370523c27c05bdde0e.scope,2:memory:/system.slice/docker-f55e7cad1fcc02f992e0c33c210ecdc6d641858a665f28370523c27c05bdde0e.scope,1:blkio,name=beancounter:/system.slice/docker-f55e7cad1fcc02f992e0c33c210ecdc6d641858a665f28370523c27c05bdde0e.scope"

match[1] will be "blkio" but not:
/system.slice/docker-f55e7cad1fcc02f992e0c33c210ecdc6d641858a665f28370523c27c05bdde0e.scope

These fixes the commit:
4cbd91c761 Make getCgroupPath work in case of named or multi- hierarchies

v2: use negated character class, correct the example, remove .* on
either end as they don't do anything in FindSubmatch.
2015-12-14 10:33:26 +03:00
Vishnu kannan
a6daa760c8 Fix goroutine leak in docker fs handler logic.
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2015-12-04 11:19:49 -08:00
Jimmi Dyson
1d6e0ec9bc Merge pull request #1002 from timstclair/loaddecay
Fix usage of housekeeping_interval flag
2015-12-04 12:55:11 +00:00
Tim St. Clair
33216870d8 Fix usage of housekeeping_interval flag
Defer calculation of `loadDecay`. Flags must be parsed before they can
be read, and therefore cannot be reliably be read at package init time.
2015-12-03 18:39:11 -08:00
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