@@ -126,7 +126,7 @@ func NewProcessCollector(opts ProcessCollectorOpts) Collector {
126
126
}
127
127
128
128
// Set up process metric collection if supported by the runtime.
129
- if _ , err := procfs .NewStat (); err == nil {
129
+ if _ , err := procfs .NewDefaultFS (); err == nil {
130
130
c .collectFn = c .processCollect
131
131
} else {
132
132
c .collectFn = func (ch chan <- Metric ) {
@@ -166,7 +166,7 @@ func (c *processCollector) processCollect(ch chan<- Metric) {
166
166
return
167
167
}
168
168
169
- if stat , err := p .NewStat (); err == nil {
169
+ if stat , err := p .Stat (); err == nil {
170
170
ch <- MustNewConstMetric (c .cpuTotal , CounterValue , stat .CPUTime ())
171
171
ch <- MustNewConstMetric (c .vsize , GaugeValue , float64 (stat .VirtualMemory ()))
172
172
ch <- MustNewConstMetric (c .rss , GaugeValue , float64 (stat .ResidentMemory ()))
@@ -185,7 +185,7 @@ func (c *processCollector) processCollect(ch chan<- Metric) {
185
185
c .reportError (ch , c .openFDs , err )
186
186
}
187
187
188
- if limits , err := p .NewLimits (); err == nil {
188
+ if limits , err := p .Limits (); err == nil {
189
189
ch <- MustNewConstMetric (c .maxFDs , GaugeValue , float64 (limits .OpenFiles ))
190
190
ch <- MustNewConstMetric (c .maxVsize , GaugeValue , float64 (limits .AddressSpace ))
191
191
} else {
0 commit comments