Skip to content

Commit

Permalink
Remove cgroup label from Linux observer metrics (#921)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
blt authored Jul 22, 2024
1 parent dfd655e commit e086914
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lading/src/observer/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,6 @@ impl Sampler {
if let Some(memory_controller) =
cgroup.controller_of::<cgroups_rs::memory::MemController>()
{
let mut labels = Vec::from(&labels);
labels.push(("cgroup", String::from(cgroup.path())));

let mem_stat = memory_controller.memory_stat();

let inactive_file = if cgroup.v2() {
Expand Down Expand Up @@ -389,9 +386,6 @@ impl Sampler {
// cgroup, parse whatever fields are present and report them back
// out as metrics.
if let Some(cpu_controller) = cgroup.controller_of::<cgroups_rs::cpu::CpuController>() {
let mut labels = Vec::from(&labels);
labels.push(("cgroup", String::from(cgroup.path())));

let cpu = cpu_controller.cpu();
for line in cpu.stat.lines() {
let mut fields = line.split_whitespace();
Expand Down

0 comments on commit e086914

Please sign in to comment.