Commit Graph

44 Commits

Author SHA1 Message Date
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
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
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
64c0d3d8c3 Migrating cAdvisor to new libcontainer.
Backwards compatability is maintained with older versions of
libcontainer.
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
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
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
Rohit Jnagal
ed155019ac Verify and fix error message nit :) 2015-01-14 01:15:13 +00:00
Rohit Jnagal
8eec529106 Merge pull request #358 from vmarmol/update-libcontainer
Update libcontainer dependency
2014-12-15 17:01:44 -08:00
Victor Marmol
91c974e913 Generate CgroupPaths when not available.
This happens always for non-Docker containers and sometimes with older Docker
containers.
2014-12-15 16:57:30 -08:00
Victor Marmol
084e809507 Merge pull request #356 from rjnagal/rename
Add systemd information to validate output.
2014-12-16 07:35:30 +08:00
Rohit Jnagal
4ec9894ea2 Add systemd information to validate output. 2014-12-15 23:26:30 +00:00
Victor Marmol
0123fe1d07 Merge pull request #355 from rjnagal/syst
Fix Docker handler for machines that use systemd just as a naming service
2014-12-16 07:07:42 +08:00
Rohit Jnagal
f585e4bc5e Fix Docker handler for machines that use systemd just as a naming service without controlling cgroups. 2014-12-15 22:58:44 +00:00
Rohit Jnagal
1953bd0e94 Bump minimum docker supported version to 1.0. 2014-12-15 16:57:22 +00:00
Victor Marmol
cb0387b41e Try to detect systemd by checking for its named cgroup hierarchy.
Fixes #342
2014-12-11 17:30:33 -08:00
Victor Marmol
0e603d2709 Let the raw driver handle the /docker container.
This will give us stats on this container and since the /docker UI
endpoint, it no longer serves the purpose it once did.
2014-11-20 06:44:35 +08:00
Victor Marmol
f97e57df88 Simplify how the Docker containers are handled.
This is done by introducting the concept of "namespaces" of container
names. The aliases of a container are under this namespace. Namespace
names are of the form:

//<namespace>/<alias>

This allows us to (within cAdvisor) query all docker containers as
//docker regardless of whether this is a systemd or a non-systemd system.

This does break our ability to handle Docker aliases with the /container
endpoint. I think this is acceptable as our support there was not
consistent between system types.
2014-11-12 18:01:47 -08:00
Victor Marmol
6e89bdef9f Add /docker/ UI endpoint.
Fixes #294
2014-11-07 08:53:52 -08:00
Victor Marmol
8aa05b0c39 Add API version v1.2 with /docker endpoint.
The /docker endpoint lists all Docker containers under one unified
namespace.
2014-10-20 22:24:01 -07:00
Vishnu Kannan
0699e7029d Avoid storage usagge calculations when aufs driver is not being used. 2014-10-07 11:48:10 +00:00
Vish Kannan
1ed9d122c1 Merge pull request #220 from vmarmol/coreos
Fix name resolution in Systemd systems
2014-09-29 11:28:23 -07:00
Satnam Singh
7ddc75c41b Squashed commit of the following:
commit 6bf9fe89f6
Author: Satnam Singh <satnam@google.com>
Date:   Fri Sep 26 10:23:16 2014 -0700

    Change error to warning during handling check.

commit c580907183
Author: Satnam Singh <satnam@google.com>
Date:   Fri Sep 26 10:21:41 2014 -0700

    Decapatalise fmt.Errorf error messages.

commit 3ecc5745d6
Author: Satnam Singh <satnam@google.com>
Date:   Fri Sep 26 10:19:15 2014 -0700

    Fix misunderstanding about when CanHandle fails.

commit adce0c5433
Author: Satnam Singh <satnam@google.com>
Date:   Fri Sep 26 10:13:32 2014 -0700

    Change the interface of CanHandle to return error information.
2014-09-26 18:06:58 -07:00
Victor Marmol
ebf231e4df Fix name resolution in Systemd systems 2014-09-23 20:01:35 -07:00
Victor Marmol
f9c45094ab Only register the Docker driver in systems using libcontainer. 2014-09-05 13:37:18 -07:00
Victor Marmol
b75dea4021 Adding --docekr_root to customize where Docker stores state.
Fixes #199
2014-08-29 14:54:40 -07:00
Vishnu Kannan
3e390e0f33 Use glog instead of 'log' library.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2014-08-07 18:38:58 +00:00
Victor Marmol
56054e3e31 Remove SplitName().
This is possible thanks to the new libcontainer interface that allows
the use of absolute paths.
2014-08-02 11:36:10 -07:00
Victor Marmol
2e9176ae64 Fix Docker container slice in systemd systems.
It should be in /system.slice/docker-*.
2014-07-23 07:46:46 -07:00
Victor Marmol
eef8c01e4e Better handle nested containers and libcontainer. 2014-07-22 18:04:08 -07:00
Vishnu Kannan
a748b53743 Docker ListContainers will work only for the '/docker' container. 2014-07-22 19:55:14 +00:00
Vishnu Kannan
f147996e9d Ignore non '/docker' containers in the docker driver. 2014-07-22 19:55:14 +00:00
Vishnu Kannan
5dfa7b64ba Removed NotActive error message from container package.
Imporved error messages.
2014-07-22 19:55:14 +00:00
Vishnu Kannan
ef13440034 Addressed comments. Another series of bug fixes.
Modified the docker driver and lmctfy driver to skip containers they cannot handle.
2014-07-22 19:55:14 +00:00
Victor Marmol
a187d74e5b Enable the simple raw driver.
It doesn't yet get the spec, but it is functional enough to use.
This removed the registration of lmctfy, the code will be removed in a
future PR once raw GetSpec() is complete.
2014-07-21 19:02:07 -07:00
Victor Marmol
a8863e6367 Initial version of the raw container driver. 2014-07-17 10:45:59 -07:00
Victor Marmol
1636c3e759 Change ContainerHandlerFactories to decide what containers they support.
This allows a ContainerHandlerFactory to register a CanHandle() function
which is called to determine whether the factory can handle a particular
container.

This commit disables being able to run cAdvisor without lmctfy. This
should be enabled again with a "no-op" global factory which I would like
to do in a separate PR.
2014-07-16 16:48:45 -07:00
Nan Deng
3718b139b3 remove StatsPercentiles in container handler 2014-06-17 12:55:51 -07:00
Rohit Jnagal
54fbc922a5 Merge remote-tracking branch 'upstream/master'
Docker-DCO-1.1-Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)
2014-06-16 17:22:48 +00:00
Rohit Jnagal
26a5cdabca Add version information for components we depend on.
Docker-DCO-1.1-Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)
2014-06-16 17:20:09 +00:00
Nan Monnand Deng
6250bf3d0f Add ContainerReference() to ContainerHandler(). 2014-06-13 18:18:26 -04:00
Victor Marmol
712f9fb32f Migrating cAdvisor code from lmctfy 2014-06-09 12:12:07 -07:00