grafana / alloy

OpenTelemetry Collector distribution with programmable pipelines
https://grafana.com/oss/alloy
Apache License 2.0
1.22k stars 149 forks source link

`cadvisor` should be configurable to look for rootfs elsewhere #306

Open james-callahan opened 9 months ago

james-callahan commented 9 months ago

Request

Currently the cadvisor component looks in the current root / for all the information it wants.

I believe we need to figure out how to get a true plumbed through to inHostNamespace in https://github.com/google/cadvisor/blob/2129e1c4fae8567551d1ac252c7a1dec27617e21/container/containerd/factory.go#L80C3-L80C18

Slack link: https://grafana.slack.com/archives/C01050C3D8F/p1699607777165129

Use case

I wish to monitor my talos system containerd instance (see https://www.talos.dev/v1.5/learn-more/components/#containerd)

Trying:

prometheus.exporter.cadvisor "system" {
  containerd_host      = "/run/containerd/containerd.sock"
  containerd_namespace = "system"
}

prometheus.scrape "system_cadvisor" {
  targets    = prometheus.exporter.cadvisor.system.targets
  forward_to = [prometheus.relabel.system_cadvisor.receiver]
}

prometheus.relabel "system_cadvisor" {
  rule {
    target_label = "job"
    replacement  = "integrations/cadvisor/system"
  }
  forward_to = [prometheus.relabel.cadvisor.receiver]
}

Did scrape my containers, but didn't fill in many fields in including e.g. id. I believe these need various mount points such as /sys to work.

github-actions[bot] commented 8 months ago

This issue has not had any activity in the past 30 days, so the needs-attention label has been added to it. If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue. The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity. Thank you for your contributions!