Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NsqExecutor ¶
type NsqExecutor struct {
// contains filtered or unexported fields
}
NsqExecutor collects all NSQ metrics from the registered collectors. This type implements the prometheus.Collector interface and can be registered in the metrics collection.
The executor takes the time needed for scraping nsqd stat endpoint and provides an extra metric for this. This metric is labeled with the scrape result ("success" or "error").
func NewNsqExecutor ¶
func NewNsqExecutor(namespace, nsqdURL, tlsCACert, tlsCert, tlsKey string) (*NsqExecutor, error)
NewNsqExecutor creates a new executor for collecting NSQ metrics.
func (*NsqExecutor) Collect ¶
func (e *NsqExecutor) Collect(out chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (*NsqExecutor) Describe ¶
func (e *NsqExecutor) Describe(ch chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface.
func (*NsqExecutor) Use ¶
func (e *NsqExecutor) Use(c StatsCollector)
Use configures a specific stats collector, so the stats could be exposed to the Prometheus system.
type StatsCollector ¶
type StatsCollector interface {
// contains filtered or unexported methods
}
StatsCollector defines an interface for collecting specific stats from a nsqd exported stats data.
func ChannelStats ¶
func ChannelStats(namespace string) StatsCollector
ChannelStats creates a new stats collector which is able to expose the channel metrics of a nsqd node to Prometheus. The channel metrics are reported per topic.
func ClientStats ¶
func ClientStats(namespace string) StatsCollector
ClientStats creates a new stats collector which is able to expose the client metrics of a nsqd node to Prometheus. The client metrics are reported per topic and per channel.
If there are too many clients, it could cause a timeout of the Prometheus collection process. So be sure the number of clients is small enough when using this collector.
func TopicStats ¶
func TopicStats(namespace string) StatsCollector
TopicStats creates a new stats collector which is able to expose the topic metrics of a nsqd node to Prometheus.