metrics

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Counters & CounterVectors
	CntGatewayIncomingHttpMessage      = "gateway_incoming_http_message"
	CntGatewayIncomingWebsocketMessage = "gateway_incoming_websocket_message"
	CntGatewayOutgoingHttpMessage      = "gateway_outgoing_http_message"
	CntGatewayOutgoingWebsocketMessage = "gateway_outgoing_websocket_message"
	CntTunnelIncomingMessage           = "tunnel_incoming_message"
	CntTunnelOutgoingMessage           = "tunnel_outgoing_message"
	CntStoreConflicts                  = "store_conflicts"

	// Gauges & GaugeVectors
	GaugeActiveWebsocketConnections = "gateway_active_websocket_conns"

	// Histograms
	HistGatewayRequestTime  = "gateway_request_time"
	HistTunnelRequestTime   = "tunnel_request_time"
	HistTunnelRoundtripTime = "tunnel_roundtrip_time"
)

Variables

View Source
var (
	SizeBucketKB     = []float64{1, 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560}
	TimeBucketMS     = []float64{0.1, 0.5, 1, 10, 20, 50, 100, 500, 1000, 2000, 3000, 5000}
	TimeBucketMicroS = []float64{1, 2, 5, 10, 20, 50, 100, 200, 300, 400, 500, 1000, 2000, 5000, 10000}
)

Functions

func AddCounter

func AddCounter(name string, v float64)

func AddCounterVec

func AddCounterVec(name string, v float64, labelValues ...string)

func InCounterVec

func InCounterVec(name string, labelValues ...string)

func IncCounter

func IncCounter(name string)

func Init

func Init(constLabels map[string]string)

func ObserveHistogram

func ObserveHistogram(name string, v float64)

func Register

func Register(registerer prometheus.Registerer)

func SetGauge

func SetGauge(name string, v float64)

Types

type Prometheus

type Prometheus struct {
	// contains filtered or unexported fields
}

func NewPrometheus

func NewPrometheus(ns string, constLabels map[string]string) *Prometheus

func (*Prometheus) Counter

func (p *Prometheus) Counter(name string) prometheus.Counter

func (*Prometheus) CounterVec

func (p *Prometheus) CounterVec(name string) *prometheus.CounterVec

func (*Prometheus) CounterVecWithLabelValues

func (p *Prometheus) CounterVecWithLabelValues(name string, labelValues ...string) prometheus.Counter

func (*Prometheus) CounterVecWithLabels

func (p *Prometheus) CounterVecWithLabels(name string, labels prometheus.Labels) prometheus.Counter

func (*Prometheus) Gauge

func (p *Prometheus) Gauge(name string) prometheus.Gauge

func (*Prometheus) GaugeVec

func (p *Prometheus) GaugeVec(name string) *prometheus.GaugeVec

func (*Prometheus) Histogram

func (p *Prometheus) Histogram(name string) prometheus.Histogram

func (*Prometheus) RegisterCounter

func (p *Prometheus) RegisterCounter(name, help string, labels map[string]string)

func (*Prometheus) RegisterCounterVec

func (p *Prometheus) RegisterCounterVec(name, help string, constLabels map[string]string, varLabels []string)

func (*Prometheus) RegisterGauge

func (p *Prometheus) RegisterGauge(name, help string, labels map[string]string)

func (*Prometheus) RegisterGaugeVec

func (p *Prometheus) RegisterGaugeVec(name, help string, constLabels map[string]string, varLabels []string)

func (*Prometheus) RegisterHistogram

func (p *Prometheus) RegisterHistogram(name, help string, buckets []float64, labels map[string]string)

func (*Prometheus) SetConstLabels

func (p *Prometheus) SetConstLabels(m map[string]string)

Jump to

Keyboard shortcuts

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