Skip to content

HostMetricsReceiver Process scraper drops metrics on machines that don't support cgroup. #43640

@falken

Description

@falken

Component(s)

receiver/hostmetrics/internal/scraper/processscraper

What happened?

Description

One one of our target machine types we do not have a /proc//cgroup file because the device does not use cgroups. This causes the process scraper to skip the publishing the metric.

Steps to Reproduce

Deploy collector with a HostMetricReceiver on a machine without cgroup support.

Expected Result

Process metrics without a cgroup specified will exist

Actual Result

No Process metrics exist

Collector version

v0.137.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

receivers:
  hostmetrics:
      process:

Log output

2025-10-17T21:14:21.603Z   error    [email protected]/obs_metrics.go:61  Error scraping metrics  {"resource": {"service.instance.id": "67ad18cd-27ac-450e-bd4e-5d8da1edecb9", "service.name": "otelcontribcol", "service.version": "0.137.0"}, "otelcol.component.id": "hostmetrics", "otelcol.component.kind": "receiver", "otelcol.signal": "metrics", "error": "error reading process cgroup for pid 27926: open /proc/27926/cgroup: no such file or directory"}
go.opentelemetry.io/collector/scraper/scraperhelper.wrapObsMetrics.func1
 go.opentelemetry.io/collector/scraper/[email protected]/obs_metrics.go:61
go.opentelemetry.io/collector/scraper.ScrapeMetricsFunc.ScrapeMetrics
 go.opentelemetry.io/collector/[email protected]/metrics.go:24
go.opentelemetry.io/collector/scraper/scraperhelper.scrapeMetrics
 go.opentelemetry.io/collector/scraper/[email protected]/controller.go:256
go.opentelemetry.io/collector/scraper/scraperhelper.NewMetricsController.func1
 go.opentelemetry.io/collector/scraper/[email protected]/controller.go:228
go.opentelemetry.io/collector/scraper/scraperhelper.(*controller[...]).startScraping.func1
 go.opentelemetry.io/collector/scraper/[email protected]/controller.go:175
root@PCVRNBA102023-1:/var/log# cat /etc/otel/config.yml

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions