Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface {
Collect(out chan<- prometheus.Metric) error
}
Collector defines the interface for collecting all metrics for Prometheus.
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 by each registered collector and provides an extra metric for this. This metric is labeled with the result ("success" or "error") and the collector.
func NewNsqExecutor ¶
func NewNsqExecutor(namespace string) *NsqExecutor
NewNsqExecutor creates a new executor for the NSQ metrics.
func (*NsqExecutor) AddCollector ¶
func (e *NsqExecutor) AddCollector(name string, c Collector)
AddCollector adds a new collector for the metrics collection. Each collector needs a unique name which is used as a label for the executor metric.
func (*NsqExecutor) Collect ¶
func (e *NsqExecutor) Collect(out chan<- prometheus.Metric)
Collect implements the prometheus.Collector interface.
func (*NsqExecutor) Describe ¶
func (e *NsqExecutor) Describe(out chan<- *prometheus.Desc)
Describe implements the prometheus.Collector interface.
type NsqdStats ¶
type NsqdStats struct {
// contains filtered or unexported fields
}
NsqdStats represents a Collector which collects all the configured stats from a nsqd node. Besides the configured stats it will also expose a metric for the total number of existing topics.
func NewNsqdStats ¶
NewNsqdStats creates a new stats collector which uses the given namespace and reads the stats from the given URL of the nsqd.
func (*NsqdStats) Collect ¶
func (s *NsqdStats) Collect(out chan<- prometheus.Metric) error
Collect collects all the registered stats metrics from the nsqd node.
func (*NsqdStats) Use ¶
func (s *NsqdStats) 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 node.
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.