func (p nginxStatusCollector) Describe(ch chan<- *prometheus.Desc) {
	ch <- p.data.connectionsTotal
	ch <- p.data.requestsTotal
	ch <- p.data.connections
}
Describe implements prometheus.Collector.
package collector
import (
	"fmt"
	"io/ioutil"
	"net/http"
	"regexp"
	"strconv"
	"github.com/golang/glog"
	"github.com/prometheus/client_golang/prometheus"
)
var (
	ac      = regexp.MustCompile(`Active connections: (\d+)`)
	sahr    = regexp.MustCompile(`(\d+)\s(\d+)\s(\d+)`)
	reading = regexp.MustCompile(`Reading: (\d+)`)
	writing = regexp.MustCompile(`Writing: (\d+)`)
	waiting = regexp.MustCompile(`Waiting: (\d+)`)
)
type (
	nginxStatusCollector struct {
		scrapeChan     chan scrapeRequest
		ngxHealthPort  int
		ngxStatusPath  string
		data           *nginxStatusData
		watchNamespace string
		ingressClass   string
	}
	nginxStatusData struct {
		connectionsTotal *prometheus.Desc
		requestsTotal    *prometheus.Desc
		connections      *prometheus.Desc
	}
	basicStatus struct {
		Active int
		Accepted int
		Handled int
		Requests int
		Reading int
		Writing int
		Waiting int
	}
)
func InitNGINXStatusCollector(watchNamespace, ingressClass string, ngxHealthPort int) error {
	const ns string = "nginx"
	const ngxStatusPath = "/nginx_status"
	p := nginxStatusCollector{
		scrapeChan:     make(chan scrapeRequest),
		ngxHealthPort:  ngxHealthPort,
		ngxStatusPath:  ngxStatusPath,
		watchNamespace: watchNamespace,
		ingressClass:   ingressClass,
	}
	p.data = &nginxStatusData{
		connectionsTotal: prometheus.NewDesc(
			prometheus.BuildFQName(ns, "", "connections_total"),
			"total number of connections with state {active, accepted, handled}",
			[]string{"ingress_class", "namespace", "state"}, nil),
		requestsTotal: prometheus.NewDesc(
			prometheus.BuildFQName(ns, "", "requests_total"),
			"total number of client requests",
			[]string{"ingress_class", "namespace"}, nil),
		connections: prometheus.NewDesc(
			prometheus.BuildFQName(ns, "", "connections"),
			"current number of client connections with state {reading, writing, waiting}",
			[]string{"ingress_class", "namespace", "state"}, nil),
	}
	err := prometheus.Register(p)
	if err != nil {
		return fmt.Errorf("error while registering nginx status collector : %v", err)
	}
	go p.Run()
	return nil
}