grafana / alloy

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

When disable_root_cgroup_stats is set to true, scraping the endpoint produces a warning in the logs #252

Open fredsig opened 6 months ago

fredsig commented 6 months ago

What's wrong?

Grafana Agent v0.39.1, setting disable_root_cgroup_stats to true will produce the following warning in the logs for every scrape on the endpoint:

level=warn msg="Error getting data for container / because of race condition" component=prometheus.exporter.cadvisor.cadvisor func=Warningf

Functionality is not affected. Could this be related to https://github.com/google/cadvisor/issues/3037 ?

Steps to reproduce

When using the prometheus.exporter.cadvisor module, set disable_root_cgroup_stats to true. Scraping the /api/v0/component/prometheus.exporter.cadvisor.cadvisor/metrics endpoint with curl will produce the warning in the log.

System information

No response

Software version

Agent v0.39.1

Configuration

prometheus.exporter.cadvisor "cadvisor" {
  docker_host = "unix:///var/run/docker.sock"
  docker_only = true
  disable_root_cgroup_stats = true
  raw_cgroup_prefix_allowlist = ["/docker/"]
  enabled_metrics = ["cpu","cpuLoad","diskIO","memory","network","oom_event","process"]
}

Logs

level=warn msg="Error getting data for container / because of race condition" component=prometheus.exporter.cadvisor.cadvisor func=Warningf
hainenber commented 6 months ago

This log's verbosity has been reduced in this commit so this noise could be fixed if the agent's cadvisor distro incorporates said change :D

github-actions[bot] commented 5 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!

rfratto commented 4 months ago

Hi there :wave:

On April 9, 2024, Grafana Labs announced Grafana Alloy, the spirital successor to Grafana Agent and the final form of Grafana Agent flow mode. As a result, Grafana Agent has been deprecated and will only be receiving bug and security fixes until its end-of-life around November 1, 2025.

To make things easier for maintainers, we're in the process of migrating all issues tagged variant/flow to the Grafana Alloy repository to have a single home for tracking issues. This issue is likely something we'll want to address in both Grafana Alloy and Grafana Agent, so just because it's being moved doesn't mean we won't address the issue in Grafana Agent :)