Skip to content

Commit e086914

Browse files
authored
Remove cgroup label from Linux observer metrics (#921)
This commit removes the `cgroup` label from Linux observer metrics as on some systems this value is essentially random, polluting the cardinality of metrics. Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent dfd655e commit e086914

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

lading/src/observer/linux.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,6 @@ impl Sampler {
357357
if let Some(memory_controller) =
358358
cgroup.controller_of::<cgroups_rs::memory::MemController>()
359359
{
360-
let mut labels = Vec::from(&labels);
361-
labels.push(("cgroup", String::from(cgroup.path())));
362-
363360
let mem_stat = memory_controller.memory_stat();
364361

365362
let inactive_file = if cgroup.v2() {
@@ -389,9 +386,6 @@ impl Sampler {
389386
// cgroup, parse whatever fields are present and report them back
390387
// out as metrics.
391388
if let Some(cpu_controller) = cgroup.controller_of::<cgroups_rs::cpu::CpuController>() {
392-
let mut labels = Vec::from(&labels);
393-
labels.push(("cgroup", String::from(cgroup.path())));
394-
395389
let cpu = cpu_controller.cpu();
396390
for line in cpu.stat.lines() {
397391
let mut fields = line.split_whitespace();

0 commit comments

Comments
 (0)