metrics

package
v1.3.0-rc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package metrics defines telemetry primitives to be used across components. it uses the prometheus format.

Index

Constants

View Source
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 ReportMessageLatency added in v1.0.0

func ReportMessageLatency(protocol, msgType string, latency time.Duration)

ReportMessageLatency records the latency for the given protocol and message type, if the protocol consists only of a single message then the protocol should be provided as the message type.

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

func StartPushingMetrics(
	url, username, password string,
	headers map[string]string,
	period time.Duration,
	nodeID, networkID string,
)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL