metrics

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRouterMetrics

func InitRouterMetrics(getRPsCount func() int, getStreamsCount func() int)

func NewHandler

func NewHandler() http.Handler

Types

type Counter

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

func NewCounter

func NewCounter(opts prometheus.CounterOpts, labels ...string) *Counter

func (*Counter) Collect

func (c *Counter) Collect(ch chan<- prometheus.Metric)

func (*Counter) Delete

func (c *Counter) Delete(l Labels)

func (*Counter) Describe

func (c *Counter) Describe(ch chan<- *prometheus.Desc)

func (*Counter) Inc

func (c *Counter) Inc()

func (*Counter) Reset

func (c *Counter) Reset()

func (*Counter) With

func (c *Counter) With(l Labels) *Counter

type Gauge

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

func NewGauge

func NewGauge(opts prometheus.GaugeOpts, labels ...string) *Gauge

func (*Gauge) Collect

func (g *Gauge) Collect(ch chan<- prometheus.Metric)

func (*Gauge) Delete

func (g *Gauge) Delete(l Labels)

func (*Gauge) Describe

func (g *Gauge) Describe(ch chan<- *prometheus.Desc)

func (*Gauge) Reset

func (g *Gauge) Reset()

func (*Gauge) Set

func (g *Gauge) Set(v float64)

func (*Gauge) With

func (g *Gauge) With(l Labels) *Gauge

type HTTPRouteMetricLabels

type HTTPRouteMetricLabels struct {
	Service, Method, Host, Visitor, Path string
}

type HealthMetricLabels

type HealthMetricLabels string

type Labels

type Labels interface {
	// contains filtered or unexported methods
}

type RouteMetrics

type RouteMetrics struct {
	HTTPReqTotal,
	HTTP2xx3xx,
	HTTP4xx,
	HTTP5xx *Counter
	HTTPReqElapsed *Gauge
}

func GetRouteMetrics

func GetRouteMetrics() *RouteMetrics

func (*RouteMetrics) UnregisterService

func (rm *RouteMetrics) UnregisterService(service string)

type ServiceMetrics

type ServiceMetrics struct {
	HealthStatus *Gauge
}

func GetServiceMetrics

func GetServiceMetrics() *ServiceMetrics

type StreamRouteMetricLabels

type StreamRouteMetricLabels struct {
	Service, Visitor string
}

Jump to

Keyboard shortcuts

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