func (c *CephExporter) Describe(ch chan<- *prometheus.Desc) {
	for _, cc := range c.collectors {
		cc.Describe(ch)
	}
}
Describe sends all the descriptors of the collectors included to
the provided channel.
package main
import (
	"net"
	"net/http"
	"os"
	"sync"
	"syscall"
	"time"
	"github.com/digitalocean/ceph_exporter/collectors"
	"github.com/ianschenck/envflag"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promhttp"
	"github.com/sirupsen/logrus"
)
const (
	defaultCephClusterLabel = "ceph"
	defaultCephConfigPath   = "/etc/ceph/ceph.conf"
	defaultCephUser         = "admin"
	defaultRadosOpTimeout   = 30 * time.Second
)
const keepAlive time.Duration = 3 * time.Minute
type emfileAwareTcpListener struct {
	*net.TCPListener
	logger *logrus.Logger
}
func (ln emfileAwareTcpListener) Accept() (c net.Conn, err error) {
	tc, err := ln.AcceptTCP()
	if err != nil {
		if oerr, ok := err.(*net.OpError); ok {
			if serr, ok := oerr.Err.(*os.SyscallError); ok && serr.Err == syscall.EMFILE {
				ln.logger.WithError(err).Fatal("running out of file descriptors")
			}
		}
		return
	}
	tc.SetKeepAlive(true)
	tc.SetKeepAlivePeriod(keepAlive)
	return tc, nil
}
type CephExporter struct {
	mu         sync.Mutex
	collectors []prometheus.Collector
	logger     *logrus.Logger
}
var _ prometheus.Collector = &CephExporter{}
func NewCephExporter(conn collectors.Conn, cluster string, config string, rgwMode int, logger *logrus.Logger) *CephExporter {
	c := &CephExporter{
		collectors: []prometheus.Collector{
			collectors.NewClusterUsageCollector(conn, cluster, logger),
			collectors.NewPoolUsageCollector(conn, cluster, logger),
			collectors.NewPoolInfoCollector(conn, cluster, logger),
			collectors.NewClusterHealthCollector(conn, cluster, logger),
			collectors.NewMonitorCollector(conn, cluster, logger),
			collectors.NewOSDCollector(conn, cluster, logger),
		},
		logger: logger,
	}
	switch rgwMode {
	case collectors.RGWModeForeground:
		c.collectors = append(c.collectors,
			collectors.NewRGWCollector(cluster, config, false, logger),
		)
	case collectors.RGWModeBackground:
		c.collectors = append(c.collectors,
			collectors.NewRGWCollector(cluster, config, true, logger),
		)
	case collectors.RGWModeDisabled:
	default:
		logger.WithField("rgwMode", rgwMode).Warn("RGW Collector Disabled do to invalid mode")
	}
	return c
}