metrics

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableMetrics

func EnableMetrics() enginemetrics.Collector

EnableMetrics will enable the metrics for the application

func NewPrometheusCollector

func NewPrometheusCollector(reg prometheus.Registerer) enginemetrics.Collector

NewPrometheusCollector creates a new PrometheusCollector.

Types

type Metrics

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

Metrics is the metrics collector

func Get

func Get() (m *Metrics, enabled bool)

Get will return the metrics if enabled

func (*Metrics) HTTPHandler

func (m *Metrics) HTTPHandler() http.Handler

HTTPHandler will return the http.Handler for the metrics

type PrometheusCollector

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

PrometheusCollector is a collector for Prometheus metrics. It should implement spvwalletmodels.Collector.

func (*PrometheusCollector) RegisterGauge

func (c *PrometheusCollector) RegisterGauge(name string) prometheus.Gauge

RegisterGauge creates a new Gauge and registers it with the collector.

func (*PrometheusCollector) RegisterGaugeVec

func (c *PrometheusCollector) RegisterGaugeVec(name string, labels ...string) *prometheus.GaugeVec

RegisterGaugeVec creates a new GaugeVec and registers it with the collector.

func (*PrometheusCollector) RegisterHistogramVec

func (c *PrometheusCollector) RegisterHistogramVec(name string, labels ...string) *prometheus.HistogramVec

RegisterHistogramVec creates a new HistogramVec and registers it with the collector.

Jump to

Keyboard shortcuts

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