Commit Graph

404 Commits

Author SHA1 Message Date
WanLinghao
4eab5b671e Add support to disable diskIO metrics 2019-01-15 09:43:33 +08:00
Davanum Srinivas
4da6d809be
Move from glog to klog
Change-Id: Ic92f57c2d7f268d8d985797974883c1a537d6993
2018-11-08 18:06:28 -05:00
Nao YONASHIRO
3d284e19eb fix: unwrap error for os.IsNotExist 2018-11-07 15:01:18 +09:00
David Ashpole
84e52259f6
Merge pull request #2093 from sashankreddya/cache_process_metrics
Cache process metrics
2018-11-06 13:38:55 -08:00
Sashank Appireddy
da29418c31 cache process metrics 2018-11-06 13:29:14 -08:00
David Ashpole
48605ecb89
Merge pull request #2085 from orisano/master
improve ListDirectories performance
2018-11-06 09:48:51 -08:00
Nao YONASHIRO
2300be56d7 feat: use karrick/godirwalk 2018-11-02 08:22:42 +09:00
Sashank Appireddy
02ecf721f5 Emit number of processes and file descriptors of a container 2018-10-29 16:55:34 -07:00
Yann Hodique
d8cdae8022 replace golang.org/x/exp/inotify with standalone library
context: kubernetes/kubernetes#68478

The inotify code was removed from golang.org/x/exp several years ago. Therefore
importing it from that path prevents downstream consumers from using any module
that makes use of more recent features of golang.org/x/exp.

Given that this code is by definition frozen and that the long term path should
be to migrate to fsnotify, replacing the current code by an identical standalone
copy doesn't have maintenance cost, and will unlock other activities for
kubernetes for example.
2018-10-22 11:53:17 -07:00
David Ashpole
c5510abcd7
Merge pull request #2060 from sigma/pr/inotify
replace golang.org/x/exp/inotify with standalone library
2018-10-19 15:35:21 -07:00
Yann Hodique
289e560efd replace golang.org/x/exp/inotify with standalone library
context: kubernetes/kubernetes#68478

The inotify code was removed from golang.org/x/exp several years ago. Therefore
importing it from that path prevents downstream consumers from using any module
that makes use of more recent features of golang.org/x/exp.

Given that this code is by definition frozen and that the long term path should
be to migrate to fsnotify, replacing the current code by an identical standalone
copy doesn't have maintenance cost, and will unlock other activities for
kubernetes for example.
2018-09-28 08:48:12 -07:00
William Zhang
7961198a0c fix spelling errors
Signed-off-by: William Zhang <zhang.wanmin@zte.com.cn>
2018-09-28 15:49:25 +08:00
Davanum Srinivas
344f728393
Avoid too many mesos errors in logs when mesos is not present
We see a lot of logs in k/k CI as follows:
"Factory "mesos" was unable to handle container "/system.slice/home-kubernetes-containerized_mounter.mount"

It would be better if we do some sanity check for mesos running before
we try to use it.

Change-Id: I5f6ebcd44fdd4f8d724b85857edf1600473ef1ab
2018-09-26 16:41:32 -04:00
Sashank Appireddy
ec4f24ebd4 Ensure that empty mesos containers reference as a failure to fetch containers 2018-09-14 15:31:50 +05:30
David Ashpole
2fa6c624a2
Merge pull request #2034 from usabilla/mapped_file
Adds mapped_file metric
2018-08-29 10:25:29 -07:00
David Ashpole
d8d7bf8b2d
Merge pull request #2014 from grnhse/use-hierarchy-for-cache
Fix cache reporting with cgroup hierarchy
2018-08-15 14:48:01 -07:00
Gijs Kunze
9e175e9ea9 Adds mapped_file metric 2018-08-09 15:14:46 +02:00
Sashank Appireddy
2c96ceb478 Ensure that labels for mesos tasks launched via MesosCommandExecutor
are collected as well
2018-08-01 17:52:51 -07:00
Valentyn Boginskey
b09b68c4a9 Fix cache reporting with cgroup hierarchy 2018-07-28 07:20:42 -04:00
David Ashpole
c225d06adf don't emit prometheus metrics that are ignored 2018-07-09 13:17:49 -07:00
Sashank Appireddy
ed0e3f0f43 Add mesos containerizer support
This commit includes support for collecting container stats
launched by mesos containerizer.
2018-06-28 22:07:55 +00:00
David Ashpole
b1535b8a39
Merge pull request #1926 from andyxning/add_docker-only_whitelist
add docker_only_prefix_whitelist
2018-06-21 11:27:17 -07:00
Antonio Murdaca
42eeba5783
container: fix concurrent map acccess
GetSpec() can be called concurrently in
manager/container.go.updateSpec()
results into a concurrent map access on the labels map because we're
directly updating the map inside GetSpec(). The labels map from the
container handler is not a copy of the map itself, just a reference,
that's why we're getting the concurrent map access.
Fix this by moving the label update with restartcount to the handler's
initialization method which is not called concurrently.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2018-06-13 19:06:47 +02:00
David Ashpole
8335af9d6b Revert "Switch from Inotify to Fsnotify"
This reverts commit c1a6d6090b.
2018-06-11 10:50:23 -07:00
Andy Xie
ed6521013f add raw container cgroup path prefix whitelist 2018-04-16 12:05:51 +08:00
David Ashpole
c1a6d6090b Switch from Inotify to Fsnotify 2018-04-09 11:09:40 -07:00
David Ashpole
4edfcdda8e
Merge pull request #1919 from Random-Liu/fix-containerd-wait
Fix containerd connection wait.
2018-03-29 17:55:09 -07:00
David Ashpole
31c5df3bd9
Merge pull request #1918 from Random-Liu/update-containerd
Update containerd to v1.0.2.
2018-03-29 17:44:24 -07:00
Lantao Liu
021065e3b9 Fix containerd connection wait.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-30 00:35:20 +00:00
Lantao Liu
cdb1f2ac71 Update containerd to v1.0.2.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-03-29 23:50:34 +00:00
nielsole
08f0c2397c Adding /proc/<pid>/schedstat (#1872)
Add /proc/<pid>/schedstat metrics for scheduler metrics
2018-03-08 09:27:06 -08:00
Lantao Liu
d5ee05fc25 Use backoff to tolerant race condition.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-23 22:04:35 +00:00
David Ashpole
e1d602d7af create libcontainer handler for common code 2018-02-21 08:53:42 -08:00
David Ashpole
c094ef0d2a
Merge pull request #1859 from andyxning/reduce_labels_for_container_info
reduce labels for container info
2018-02-21 08:33:17 -08:00
Bryan Boreham
ec6da3acae Prometheus metrics: optionally export total CPU instead of per-CPU
Per-CPU stats are more expensive to transport and store, and that
level of detail is not required in many cases.

We export overall total cpu in the same metric as per-cpu, so that
dashboards which previously summed over cpu will work identically.
2018-02-20 13:58:44 +00:00
David Ashpole
6116f26530
Merge pull request #1882 from dashpole/overlay_upper
monitor only the upper directory for overlay
2018-02-08 11:18:43 -08:00
Yanqiang Miao
1dd9469469 All handlers of containerd containers share a single client instance
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2018-02-08 12:21:51 +08:00
James Ravn
e660d8b8b7 Retry docker status on startup
For https://github.com/google/cadvisor/issues/1866.
2018-02-06 10:31:11 +00:00
David Ashpole
812cc819ac monitor only the upper directory for overlay 2018-02-05 15:49:27 -08:00
Andy Xie
1ccbe6fdd0 reduce labels for container info 2018-01-12 00:14:01 +08:00
David Ashpole
9ffa37396f
Merge pull request #1806 from sentinelt/master
fix #1607; use container creation time provided by Docker handler
2017-12-20 11:25:35 -08:00
James Ravn
57e17d8be2 Add timeouts for docker queries
As these can otherwise block indefinitely due to docker issues.

This is to fix https://github.com/kubernetes/kubernetes/issues/53207,
where kubelet relies on cadvisor for gathering docker information as
part of its periodic node status update.
2017-12-05 13:50:48 +00:00
Tim Allclair
5b435b4b70
Clean up cAdvisor logging 2017-11-27 19:48:05 -08:00
David Ashpole
6988e70a3d Revert "fix #1708; move from inotify to fsnotify"
This reverts commit e6b6a1ac57.
2017-11-17 10:28:28 -08:00
Sławek Piotrowski
2648be083a fix #1607; use container creation time provided by Docker handler 2017-11-16 00:41:10 +01:00
David Ashpole
4466b4d9a0
Merge pull request #1795 from abhi/containerd
Containerd cadvisor integration
2017-11-15 10:24:53 -08:00
abhi
6ad15431f4 Integrating containerd to cadvisor
This commit includes changes to integrate containerd
runtime to cadvisor to collect container stats

Signed-off-by: abhi <abhi@docker.com>

Test cases and minor changes

This commit include test cases and minor fixes
for the same

Signed-off-by: abhi <abhi@docker.com>
2017-11-14 17:37:36 -08:00
Derek Carr
49e0496c8f
Merge pull request #1773 from runcom/crio-socket-edit
container: crio: change crio socket
2017-11-14 11:18:15 -05:00
Euan Kemp
1ecd24ea8d libcontainer: Use first cgroup subsystem found (#1792)
libcontainer: Use first cgroup subsystem found
2017-11-06 15:33:59 -08:00
Rohit Agarwal
4a35130019 Collect container-level GPU metrics using NVML.
When cAdvisor starts up, it would read the `vendor` files in
`/sys/bus/pci/devices/*` to see if any NVIDIA devices (vendor ID: 0x10de) are
attached to the node. If no NVIDIA devices are found, this code path would
become dormant for the rest of cAdvisor lifetime. If NVIDIA devices are found,
we would start a goroutine that would check for the presence of NVML by trying
to dynamically load it at regular intervals. We need to do this regular
checking instead of doing it just once because it may happen that cAdvisor is
started before the NVIDIA drivers and NVML are installed.  Once the NVML
dynamic loading succeeds, we would use NVML’s query methods to find out how
many devices exist on the node and create a map from their minor numbers to
their handles and cache that map. The goroutine would exit at this point.

If we detected the presence of NVML in the previous step, whenever a new
container is detected by cAdvisor, cAdvisor would read the `devices.list` file
from the container's devices cgroup. The `devices.list` file lists the
major:minor number of all the devices that the container is allowed to access.
If we find any device with major number 195 (which is the major number assigned
to NVIDIA devices), we would cache the list of corresponding minor numbers for
that container.

During every housekeeping operation, in addition to collecting all the existing
metrics, we will use the cached NVIDIA device minor numbers and the map from
minor numbers to device handles to get metrics for GPU devices attached to the
container.
2017-11-06 11:54:59 -08:00