code: func NewProcessStatCollector() (Collector, error) {
  	fs, err := procfs.NewFS(*procPath)
  	if err != nil {
  		return nil, fmt.Errorf("failed to open procfs: %v", err)
  	}
  	subsystem := "processes"
  	return &processCollector{
  		fs: fs,
  		threadAlloc: prometheus.NewDesc(
  			prometheus.BuildFQName(namespace, subsystem, "threads"),
  			"Allocated threads in system",
  			nil, nil,
  		),
  		threadLimit: prometheus.NewDesc(
  			prometheus.BuildFQName(namespace, subsystem, "max_threads"),
  			"Limit of threads in the system",
  			nil, nil,
  		),
  		procsState: prometheus.NewDesc(
  			prometheus.BuildFQName(namespace, subsystem, "state"),
  			"Number of processes in each state.",
  			[]string{"state"}, nil,
  		),
  		pidUsed: prometheus.NewDesc(prometheus.BuildFQName(namespace, subsystem, "pids"),
  			"Number of PIDs", nil, nil,
  		),
  		pidMax: prometheus.NewDesc(prometheus.BuildFQName(namespace, subsystem, "max_processes"),
  			"Number of max PIDs limit", nil, nil,
  		),
  	}, nil
  }
docs: // NewProcessStatCollector returns a new Collector exposing process data read from the proc filesystem.