metrics

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Overview

Package metrics exposes standardized functions for creating new counters, gauges and histograms. Ideally if we use this package everywhere, we can ensure consistently named metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCounter

func NewCounter(subsystem Subsystem, name, help string, labels ...string) *prometheus.CounterVec

NewCounter will return a prometheus counter object with labels for network and provider.

func NewGauge

func NewGauge(subsystem Subsystem, name, help string, labels ...string) *prometheus.GaugeVec

NewGauge will return a prometheus gauge with labels for network and provider.

func NewGaugeWithoutLabels

func NewGaugeWithoutLabels(subsystem Subsystem, name, help string) prometheus.Gauge

NewGaugeWithoutLabels will return a prometheus gauge without labels.

func NewHistogram

func NewHistogram(subsystem Subsystem, name, help string, buckets []float64, labels ...string) *prometheus.HistogramVec

NewHistogram will return a configured histogram with labels for network and provider.

Types

type Subsystem

type Subsystem int

Subsystem defines the different types of providers that we use to get data.

const (
	RPC Subsystem = iota
	Sensor
	Heimdall
	System
)

func (Subsystem) String

func (i Subsystem) String() string

Jump to

Keyboard shortcuts

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