This add Envs to container spec as a metadata source. When using prometheus
exposition format, they will be merged into the list of metrics' labels.
Also changed the cli flag to docker_env_metadata_whitelist, and add refenrences
of whitelist envs to API
Signed-off-by: Daniel Dao <dqminh@cloudflare.com>
- Fix#743
- Rewrite InfluxDB storage for new InfluxDB API data structures.
- Store each measurement separately instead of storing all measurements
in a single big "table" with many columns/fields.
- Use tags add metadata to points, such as the container name. Tags are
a new feature in InfluxDB 0.9.
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.
The documentation for custom metrics contained an error in the
Prometheus metrics example JSON, and was also somewhat unclear
as to how the labels worked.
Previously, the Prometheus collector ignored the
`MetricsConfig` field of the custom metrics specification,
simply storing all exposed metrics. Now, if the `MetricsConfig`
field contains any metric names, only those metrics will be stored
and exposed.
Fixes#1005