metrics

package
v0.31.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address string
	Enabled bool
}

Config is a params to configure service.

type Description added in v0.28.0

type Description struct {
	Type           dto.MetricType
	Namespace      string
	Subsystem      string
	Name           string
	Help           string
	ConstantLabels prometheus.Labels
	VariableLabels []string
}

func DescribeAll added in v0.28.0

func DescribeAll() []Description

DescribeAll returns descriptions for metrics.

func (*Description) BuildFQName added in v0.28.0

func (d *Description) BuildFQName() string

func (*Description) MarshalJSON added in v0.28.0

func (d *Description) MarshalJSON() ([]byte, error)

type GateMetrics

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

func NewGateMetrics

func NewGateMetrics(p StatisticScraper) *GateMetrics

NewGateMetrics creates new metrics for http gate.

func (*GateMetrics) Collect

func (m *GateMetrics) Collect(ch chan<- prometheus.Metric)

func (*GateMetrics) Describe

func (m *GateMetrics) Describe(descs chan<- *prometheus.Desc)

func (GateMetrics) MarkHealthy added in v0.28.0

func (m GateMetrics) MarkHealthy(endpoint string)

func (GateMetrics) MarkUnhealthy added in v0.28.0

func (m GateMetrics) MarkUnhealthy(endpoint string)

func (GateMetrics) SetHealth

func (m GateMetrics) SetHealth(s HealthStatus)

func (GateMetrics) SetVersion added in v0.28.0

func (m GateMetrics) SetVersion(ver string)

func (*GateMetrics) Unregister

func (g *GateMetrics) Unregister()

type HealthStatus

type HealthStatus int32

HealthStatus of the gate application.

const (
	HealthStatusUndefined    HealthStatus = 0
	HealthStatusStarting     HealthStatus = 1
	HealthStatusReady        HealthStatus = 2
	HealthStatusShuttingDown HealthStatus = 3
)

type Service

type Service struct {
	*http.Server
	// contains filtered or unexported fields
}

Service serves metrics.

func NewPprofService

func NewPprofService(l *zap.Logger, cfg Config) *Service

NewPprofService creates a new service for gathering pprof metrics.

func NewPrometheusService

func NewPrometheusService(log *zap.Logger, cfg Config) *Service

NewPrometheusService creates a new service for gathering prometheus metrics.

func (*Service) ShutDown

func (ms *Service) ShutDown(ctx context.Context)

ShutDown stops the service.

func (*Service) Start

func (ms *Service) Start()

Start runs http service with the exposed endpoint on the configured port.

type StatisticScraper added in v0.28.0

type StatisticScraper interface {
	Statistic() pool.Statistic
}

Jump to

Keyboard shortcuts

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