Documentation ¶
Overview ¶
Package metrics is a gateway for Prometheus monitoring system, it based on Prometheus golang client. Package contains metrics collectors descriptions of entire project. Component starts http server on http://0.0.0.0:8080/metrics by default(can be changed in configuration)
Example:
// starts metrics server cfg := configuration.NewMetrics() m, _ := NewMetrics(cfg) m.Start(nil) // manipulate with network metrics NetworkMessageSentTotal.Inc() NetworkPacketSentTotal.WithLabelValues("ping").Add(55)
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NetworkFutures = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "futures", Help: "Current network transport futures count", Namespace: insolarNamespace, Subsystem: "network", }, []string{"packetType"})
NetworkFutures is current network transport futures count metric
var NetworkMessageSentTotal = prometheus.NewCounter(prometheus.CounterOpts{
Name: "message_sent_total",
Help: "Total number of sent messages",
Namespace: insolarNamespace,
Subsystem: "network",
})
NetworkMessageSentTotal is total number of sent messages metric
var NetworkPacketReceivedTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "packet_received_total", Help: "Total number of received packets", Namespace: insolarNamespace, Subsystem: "network", }, []string{"packetType"})
NetworkPacketReceivedTotal is is total number of received packets metric
var NetworkPacketSentTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "packet_sent_total", Help: "Total number of sent packets", Namespace: insolarNamespace, Subsystem: "network", }, []string{"packetType"})
NetworkPacketSentTotal is total number of sent packets metric
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
Metrics is a component which serve metrics data to Prometheus.
func NewMetrics ¶
func NewMetrics(cfg configuration.Metrics) (*Metrics, error)
NewMetrics creates new Metrics component.