prometheus

package
v0.0.0-...-dc2afbb Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultHttpHandlerOptions = promhttp.HandlerOpts{
		Timeout:             10 * time.Second,
		DisableCompression:  true,
		MaxRequestsInFlight: 10,
		EnableOpenMetrics:   true,
	}
)

Functions

func StringSliceToPrometheusLabels

func StringSliceToPrometheusLabels(keysAndValues []string) prometheus.Labels

Types

type Counter

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

func NewCounter

func NewCounter(options ...MetricOption) *Counter

func (*Counter) Add

func (c *Counter) Add(value float64)

func (*Counter) WithLabelValues

func (c *Counter) WithLabelValues(values ...string) metrics.Counter

func (*Counter) WithLabels

func (c *Counter) WithLabels(keysAndValues ...string) metrics.Counter

type Gauge

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

func NewGauge

func NewGauge(options ...MetricOption) *Gauge

func (*Gauge) Add

func (g *Gauge) Add(value float64)

func (*Gauge) Set

func (g *Gauge) Set(value float64)

func (*Gauge) Sub

func (g *Gauge) Sub(value float64)

func (*Gauge) WithLabelValues

func (g *Gauge) WithLabelValues(values ...string) metrics.Gauge

func (*Gauge) WithLabels

func (g *Gauge) WithLabels(keysAndValues ...string) metrics.Gauge

type Histogram

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

func NewHistogram

func NewHistogram(options ...MetricOption) *Histogram

func (*Histogram) Observe

func (g *Histogram) Observe(value float64)

func (*Histogram) WithLabelValues

func (g *Histogram) WithLabelValues(values ...string) metrics.Histogram

func (*Histogram) WithLabels

func (g *Histogram) WithLabels(keysAndValues ...string) metrics.Histogram

type MetricOption

type MetricOption func(*MetricOptionSet)

func InterfaceSliceToMetricOptionSlice

func InterfaceSliceToMetricOptionSlice(interfaceOptions []interface{}) []MetricOption

func WithBuckets

func WithBuckets(buckets []float64) MetricOption

func WithHelp

func WithHelp(help string) MetricOption

func WithLabels

func WithLabels(labels []string) MetricOption

func WithName

func WithName(name string) MetricOption

func WithNamespace

func WithNamespace(namespace string) MetricOption

func WithRegistry

func WithRegistry(registry *prometheus.Registry) MetricOption

func WithSubsystem

func WithSubsystem(subsystem string) MetricOption

type MetricOptionSet

type MetricOptionSet struct {
	prometheus.Opts
	Buckets []float64
	Labels  []string
	// contains filtered or unexported fields
}

func NewMetricOptionSet

func NewMetricOptionSet(options ...MetricOption) *MetricOptionSet

func (*MetricOptionSet) AsCounterOpts

func (o *MetricOptionSet) AsCounterOpts() prometheus.CounterOpts

func (*MetricOptionSet) AsGaugeOpts

func (o *MetricOptionSet) AsGaugeOpts() prometheus.GaugeOpts

func (*MetricOptionSet) AsHistogramOpts

func (o *MetricOptionSet) AsHistogramOpts() prometheus.HistogramOpts

type MetricService

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

func NewMetricService

func NewMetricService(options ...MetricServiceOption) *MetricService

func (*MetricService) Counter

func (m *MetricService) Counter(options ...interface{}) metrics.Counter

func (*MetricService) Gauge

func (m *MetricService) Gauge(options ...interface{}) metrics.Gauge

func (*MetricService) Handler

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

func (*MetricService) Histogram

func (m *MetricService) Histogram(options ...interface{}) metrics.Histogram

func (*MetricService) Push

func (m *MetricService) Push() error

type MetricServiceOption

type MetricServiceOption func(*MetricService)

func WithHttpHandlerOptions

func WithHttpHandlerOptions(httpHandlerOptions promhttp.HandlerOpts) MetricServiceOption

func WithPusher

func WithPusher(url, job string) MetricServiceOption

func WithPusherGrouping

func WithPusherGrouping(key, value string) MetricServiceOption

Jump to

Keyboard shortcuts

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