Files
nsq_exporter/collector/collector.go
nordicdyno f5cc502874 Refactoring for better Prometheus' logic support
1) Breaking changes! Updated collection code for proper Prometheus support
- Now metrics names of all subcollectors have prefixes:
  nsq_topic_, nsq_channel_, nsq_client_
  As a result metrics registration code now passing Prometheus' client validation,
  also it fixes scrape warnings
- "type" label in exported metrics removed as obsolete
2) Add reset of gauges before scrape (like in haproxy-exporter)
3) Refactor: subcollectors logic is simplified, multiple collectors support removed
   We always use 'stats' collector so it removes unnecessary flexibility and complexity.
2017-02-13 15:56:33 +03:00

13 lines
316 B
Go

package collector
import "github.com/prometheus/client_golang/prometheus"
// StatsCollector defines an interface for collecting specific stats
// from a nsqd exported stats data.
type StatsCollector interface {
set(s *stats)
collect(out chan<- prometheus.Metric)
describe(ch chan<- *prometheus.Desc)
reset()
}