Documentation ¶
Overview ¶
Package metrics defines telemetry primitives to be used across components. it uses the prometheus format.
Index ¶
- Constants
- func NewCounter(name, subsystem, help string, labels []string) *prometheus.CounterVec
- func NewGauge(name, subsystem, help string, labels []string) *prometheus.GaugeVec
- func NewHistogram(name, subsystem, help string, labels []string) *prometheus.HistogramVec
- func NewHistogramWithBuckets(name, subsystem, help string, labels []string, buckets []float64) *prometheus.HistogramVec
- func StartMetricsServer(metricsPort int)
- func StartPushingMetrics(url string, periodSec int, nodeID, networkID string)
Constants ¶
const (
// Namespace is the basic namespace where all metrics are defined under.
Namespace = "spacemesh"
)
Variables ¶
This section is empty.
Functions ¶
func NewCounter ¶
func NewCounter(name, subsystem, help string, labels []string) *prometheus.CounterVec
NewCounter creates a Counter metrics under the global namespace returns nop if metrics are disabled.
func NewGauge ¶
func NewGauge(name, subsystem, help string, labels []string) *prometheus.GaugeVec
NewGauge creates a Gauge metrics under the global namespace returns nop if metrics are disabled.
func NewHistogram ¶
func NewHistogram(name, subsystem, help string, labels []string) *prometheus.HistogramVec
NewHistogram creates a Histogram metrics under the global namespace returns nop if metrics are disabled.
func NewHistogramWithBuckets ¶ added in v1.0.0
func NewHistogramWithBuckets(name, subsystem, help string, labels []string, buckets []float64) *prometheus.HistogramVec
NewHistogramWithBuckets creates a Histogram metrics with custom buckets.
func StartMetricsServer ¶ added in v1.0.0
func StartMetricsServer(metricsPort int)
StartMetricsServer begins listening and supplying metrics on localhost:`metricsPort`/metrics.
func StartPushingMetrics ¶ added in v1.0.0
StartPushingMetrics begins pushing metrics to the url specified by the --metrics-push flag with period specified by the --metrics-push-period flag.
Types ¶
This section is empty.