prometheus/prometheus.go
func NewCounter(options *CounterOptions) (c *Counter) {
	if options == nil {
		options = new(CounterOptions)
	}
	if options.Name == "" {
		options.Name = "logging_messages_total"
	}
	if options.Help == "" {
		options.Help = "Number of log messages processed, partitioned by log level."
	}
	vector := prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: options.Name,
			Help: options.Help,
		},
		[]string{"level"},
	)
	return &Counter{
		vector:           vector,
		emergencyCounter: vector.WithLabelValues("emergency"),
		alertCounter:     vector.WithLabelValues("alert"),
		criticalCounter:  vector.WithLabelValues("critical"),
		errorCounter:     vector.WithLabelValues("error"),
		warningCounter:   vector.WithLabelValues("warning"),
		noticeCounter:    vector.WithLabelValues("notice"),
		infoCounter:      vector.WithLabelValues("info"),
		debugCounter:     vector.WithLabelValues("debug"),
	}
}
func NewCounter(options *CounterOptions) (c *Counter) {
	if options == nil {
		options = new(CounterOptions)
	}
	if options.Name == "" {
		options.Name = "logging_messages_total"
	}
	if options.Help == "" {
		options.Help = "Number of log messages processed, partitioned by log level."
	}
	vector := prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: options.Name,
			Help: options.Help,
		},
		[]string{"level"},
	)
	return &Counter{
		vector:           vector,
		emergencyCounter: vector.WithLabelValues("emergency"),
		alertCounter:     vector.WithLabelValues("alert"),
		criticalCounter:  vector.WithLabelValues("critical"),
		errorCounter:     vector.WithLabelValues("error"),
		warningCounter:   vector.WithLabelValues("warning"),
		noticeCounter:    vector.WithLabelValues("notice"),
		infoCounter:      vector.WithLabelValues("info"),
		debugCounter:     vector.WithLabelValues("debug"),
	}
}
// NewCounter creates new Counter instance.
// Options value can be nil.