metrics

package
v0.0.0-...-7a62f64 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAddress = ":9090"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Class

type Class int
const (
	Counter Class = iota
	Gauge
	Histogram
	Summary
)

type MetricWriter

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

func (*MetricWriter) Collect

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

func (*MetricWriter) Describe

func (m *MetricWriter) Describe(ch chan<- *prometheus.Desc)

func (*MetricWriter) PutMetric

func (m *MetricWriter) PutMetric(metric string, class Class, value float64)

type MetricWriterOpts

type MetricWriterOpts func(*MetricWriter)

func WithNamespace

func WithNamespace(namespace string) MetricWriterOpts

type Server

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

func NewServer

func NewServer(opts ...SeverOpt) *Server

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

type SeverOpt

type SeverOpt func(*Server)

func WithAddress

func WithAddress(address string) SeverOpt

func WithCollectors

func WithCollectors(collectors ...prometheus.Collector) SeverOpt

func WithHandlerOpts

func WithHandlerOpts(opts promhttp.HandlerOpts) SeverOpt

func WithRegistry

func WithRegistry(registry *prometheus.Registry) SeverOpt

type Writer

type Writer interface {
	PutMetric(metric string, class Class, value float64)
	Collect(ch chan<- prometheus.Metric)
	Describe(ch chan<- *prometheus.Desc)
}

func NewMetricWriter

func NewMetricWriter(opts ...MetricWriterOpts) Writer

Jump to

Keyboard shortcuts

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