Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions prometheus/process_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func NewProcessCollectorPIDFn(
}

// Set up process metric collection if supported by the runtime.
if processCollectSupported() {
if _, err := procfs.NewStat(); err == nil {
c.collectFn = c.processCollect
}

Expand All @@ -103,13 +103,6 @@ func (c *processCollector) Collect(ch chan<- Metric) {
c.collectFn(ch)
}

func processCollectSupported() bool {
if _, err := procfs.NewStat(); err == nil {
return true
}
return false
}

// TODO(ts): Bring back error reporting by reverting 7faf9e7 as soon as the
// client allows users to configure the error behavior.
func (c *processCollector) processCollect(ch chan<- Metric) {
Expand Down