Add white_listed_container_labels flag to white list container labels for prometheus metrics
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
Some reverse proxies do not support overriding 'Location' header
in 3xx responses. This commit adds a --url_base_prefix option
that adds a prefix to all URLs of cAdvisor so that
redirects go to the correct places.
when cadvisor exports metrics for docker containers, there is a root cgroup (/) and cgroup for a docker container (/docker/uuid).
If docker container has a label on it, then this label is applied to all containers including the root container.
Because some containers don't have that label, the label will have an empty value. The reason for this is that Prometheus
does not allow sending a metric with the same name, but different labels, so cadvisor uses empty label values based on
the set of all labels for a given metric. This can result in many docker containers getting a large number of empty labels
because another container has that label.
If large number of docker labels vary a lot across images, then the set of labels will be enormous, where most of the labels
will be empty and have no value as prometheus metrics. To avoid this problem, a flag is provided that allows a user to
disable exporting docker labels as metrics.
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.
Fix storage driver flag to show all the registered drivers as
options. Result:
```
-storage_driver driver
storage driver to use. Data is always cached shortly
in memory, this controls where data is pushed besides
the local cache. Empty means none. Options are:
<empty>, bigquery, elasticsearch, influxdb, kafka,
redis, statsd, stdout
```
1. Fix for writing to nil map when value is non-empty.
2. Fix the usage string: go flag package uses backticks for the flag
name.
3. Render the flag default value in the same format as the flag accepts.
The current structure is a remnant of when the in memory storage was one
of the options for backing store. Today, we always have the memory
storage with an optional "backend storage" plugin. This commit makes the
InMemoryStorage use explicit.
This is read once at start of cAdvisor. We can use this to report
machine state as well as return logical name for block devices in UI.
Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)