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 APIContractExecutionTime = prometheus.NewSummaryVec(prometheus.SummaryOpts{ Name: "contract_execution_time", Help: "Time spent on execution contract, measured from API", Namespace: insolarNamespace, Subsystem: "API", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.95: 0.005, 0.99: 0.001}, }, []string{"method", "success"})
var ErrBind = errors.New("Failed to bind")
ErrBind special case for Start method. We can use it for easier check in metrics creation code.
var InsgorundCallsTotal = prometheus.NewCounter(prometheus.CounterOpts{
Name: "call_contract_method_total",
Help: "Total number of calls contracts methods",
Namespace: insgorundNamespace,
})
var InsgorundContractExecutionTime = prometheus.NewSummaryVec(prometheus.SummaryOpts{ Name: "contract_execution_time", Help: "Time spent on execution contract", Namespace: insgorundNamespace, Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.95: 0.005, 0.99: 0.001}, }, []string{"method"})
var NetworkComplete = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "complete_network_state",
Help: "Timestamp when the node reaches complete network state",
Namespace: insolarNamespace,
Subsystem: "network",
})
NetworkComplete is metric that is committed when the node reaches complete network state
var NetworkConnections = prometheus.NewGauge(prometheus.GaugeOpts{
Name: "connections",
Help: "Current network transport connections count",
Namespace: insolarNamespace,
Subsystem: "network",
})
NetworkConnections is current network transport connections count metric
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 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
var NetworkPacketTimeoutTotal = prometheus.NewCounterVec(prometheus.CounterOpts{ Name: "packet_timeout_total", Help: "Total number of timed out packets", Namespace: insolarNamespace, Subsystem: "network", }, []string{"packetType"})
NetworkPacketTimeoutTotal is is total number of timed out packets metric
var NetworkRecvSize = prometheus.NewCounter(prometheus.CounterOpts{
Name: "recv_bytes",
Help: "Recieved by transport",
Namespace: insolarNamespace,
Subsystem: "network",
})
NetworkRecvSize is total received bytes
var NetworkSentSize = prometheus.NewCounter(prometheus.CounterOpts{
Name: "sent_bytes",
Help: "Sent by transport",
Namespace: insolarNamespace,
Subsystem: "network",
})
NetworkSentSize is total sent bytes
Functions ¶
func GetInsgorundRegistry ¶ added in v0.7.5
func GetInsgorundRegistry() *prometheus.Registry
func GetInsolarRegistry ¶ added in v0.7.5
func GetInsolarRegistry(nodeRole string) *prometheus.Registry
GetInsolarRegistry creates and registers Insolar global metrics
func IsAddrInUse ¶ added in v0.6.3
IsAddrInUse checks error text for well known phrase.
func IsServerClosed ¶ added in v0.6.3
IsServerClosed checks error text for well known phrase.
Types ¶
type Metrics ¶
type Metrics struct { CertificateManager core.CertificateManager `inject:""` // contains filtered or unexported fields }
Metrics is a component which serve metrics data to Prometheus.
func NewMetrics ¶
func NewMetrics(ctx context.Context, cfg configuration.Metrics, registry *prometheus.Registry, nodeRole string) (*Metrics, error)
NewMetrics creates new Metrics component.
func (*Metrics) AddrString ¶ added in v0.6.3
AddrString returns listener address.