prometheus

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	telemetry.Metric
}

The Self-telemetry data collection interface.

type Counter

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

The counter metric.

func (*Counter) Add

func (c *Counter) Add(val float64, labelValues ...string)

Add float value.

func (*Counter) Inc

func (c *Counter) Inc(labelValues ...string)

Add one.

type DynamicGauge

type DynamicGauge struct {
	Collector
	// contains filtered or unexported fields
}

func (*DynamicGauge) Dec

func (i *DynamicGauge) Dec(labels ...string)

func (*DynamicGauge) Inc

func (i *DynamicGauge) Inc(labels ...string)

type Gauge

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

type SelfTelemetryMetaFunc

type SelfTelemetryMetaFunc func() (string, prometheus.Collector)

SelfTelemetryMetaFunc returns the metric name and the metric instance.

type Server

type Server struct {
	telemetry.PrometheusConfig

	Gatherer prometheus.Gatherer // The gatherer is for fetching metrics from the registry.
	// contains filtered or unexported fields
}

func (*Server) AfterSharingStart

func (s *Server) AfterSharingStart() error

func (*Server) Close

func (s *Server) Close() error

func (*Server) NewCounter

func (s *Server) NewCounter(name, help string, labels ...string) telemetry.Counter

NewCounter create a new counter if no metric with the same name exists.

func (*Server) NewDynamicGauge

func (s *Server) NewDynamicGauge(name, help string, labels ...string) telemetry.DynamicGauge

func (*Server) NewGauge

func (s *Server) NewGauge(name, help string, getter func() float64, labels ...string) telemetry.Gauge

func (*Server) NewTimer

func (s *Server) NewTimer(name, help string, labels ...string) telemetry.Timer

NewCounter create a new counter if no metric with the same name exists.

func (*Server) Register

func (s *Server) Register(meta ...SelfTelemetryMetaFunc)

Register registers the metric meta to the registerer.

func (*Server) Start

func (s *Server) Start(config *telemetry.Config) error

func (*Server) WithMeta

func (s *Server) WithMeta(name string, collector prometheus.Collector) SelfTelemetryMetaFunc

WithMeta is used as the param of the Register function.

type TimeRecorder

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

func (*TimeRecorder) Stop

func (c *TimeRecorder) Stop()

Stop the time and record the time

type Timer

type Timer struct {
	Collector
	// contains filtered or unexported fields
}

func (*Timer) AddTime

func (c *Timer) AddTime(t time.Duration, labelValues ...string)

AddTime add a new duration and count

func (*Timer) Start

func (c *Timer) Start(labelValues ...string) telemetry.TimeRecorder

Start a new time recorder

Jump to

Keyboard shortcuts

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