metric

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = StdConfig("").Build()
)

Functions

func Handler added in v1.0.0

func Handler() http.Handler

Handler metrics http

Types

type Config added in v1.0.0

type Config struct {
	Namespace     string        `config:"namespace"`
	Subsystem     string        `config:"subsystem"`
	PushEnabled   bool          `config:"pushEnabled"`
	PushTargetURL string        `config:"pushTargetURL"`
	PushInterval  time.Duration `config:"pushInterval"`
}

func DefaultConfig added in v1.0.0

func DefaultConfig(key string) *Config

DefaultConfig is default config.

func StdConfig added in v1.0.0

func StdConfig(key string, optionFunc ...OptionFunc) *Config

StdConfig load config from config center.

func (*Config) Build added in v1.0.0

func (c *Config) Build() *Metric

Build a instance.

func (*Config) Path added in v1.0.0

func (c *Config) Path() string

Path is config path.

type CounterVec added in v1.0.0

type CounterVec = prometheus.CounterVec

func NewCounterVec added in v1.0.0

func NewCounterVec(name, help string, labels []string) *CounterVec

NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.

type GaugeVec added in v1.0.0

type GaugeVec = prometheus.GaugeVec

func NewGaugeVec added in v1.0.0

func NewGaugeVec(name, help string, labels []string) *GaugeVec

NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.

type HistogramVec added in v1.0.0

type HistogramVec = prometheus.HistogramVec

func NewHistogramVec added in v1.0.0

func NewHistogramVec(name, help string, labels []string, buckets []float64) *HistogramVec

NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and partitioned by the given label names.

type Metric

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

Metric config

func (*Metric) Handler added in v1.0.0

func (m *Metric) Handler() http.Handler

Handler metrics http

func (*Metric) Name

func (m *Metric) Name() string

Name config name

func (*Metric) NewCounterVec added in v1.0.0

func (m *Metric) NewCounterVec(name, help string, labels []string) *CounterVec

NewCounterVec creates a new CounterVec based on the provided CounterOpts and partitioned by the given label names.

func (*Metric) NewGaugeVec added in v1.0.0

func (m *Metric) NewGaugeVec(name, help string, labels []string) *GaugeVec

NewGaugeVec creates a new GaugeVec based on the provided GaugeOpts and partitioned by the given label names.

func (*Metric) NewHistogramVec added in v1.0.0

func (m *Metric) NewHistogramVec(name, help string, labels []string, buckets []float64) *HistogramVec

NewHistogramVec creates a new HistogramVec based on the provided HistogramOpts and partitioned by the given label names.

func (*Metric) NewSummaryVec added in v1.0.0

func (m *Metric) NewSummaryVec(name, help string, labels []string, objectives map[float64]float64) *SummaryVec

NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and partitioned by the given label names.

func (*Metric) Serve

func (m *Metric) Serve(context.Context) error

Serve start serve

func (*Metric) Shutdown

func (m *Metric) Shutdown(context.Context) error

Shutdown close clients when Shutdown

type OptionFunc

type OptionFunc func(*Config)

OptionFunc is option function.

type SummaryVec added in v1.0.0

type SummaryVec = prometheus.SummaryVec

func NewSummaryVec added in v1.0.0

func NewSummaryVec(name, help string, labels []string, objectives map[float64]float64) *SummaryVec

NewSummaryVec creates a new SummaryVec based on the provided SummaryOpts and partitioned by the given label names.

Jump to

Keyboard shortcuts

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