Versions in this module Expand all Collapse all v1 v1.5.2 Jun 15, 2023 Changes in this version + const DefAgeBuckets + const DefBufCap + const DefMaxAge + const DefNativeHistogramZeroThreshold + const ExemplarMaxRunes + const NativeHistogramZeroThresholdZero + var CounterMetricTypePtr = func() *dto.MetricType { ... }() + var DefBuckets = []float64 + var DefaultGatherer Gatherer = defaultRegistry + var DefaultRegisterer Registerer = defaultRegistry + var GaugeMetricTypePtr = func() *dto.MetricType { ... }() + var UntypedMetricTypePtr = func() *dto.MetricType { ... }() + var V2 = v2 + func BuildFQName(namespace, subsystem, name string) string + func DescribeByCollect(c Collector, descs chan<- *Desc) + func ExponentialBuckets(start, factor float64, count int) []float64 + func ExponentialBucketsRange(min, max float64, count int) []float64 + func LinearBuckets(start, width float64, count int) []float64 + func MakeLabelPairs(desc *Desc, labelValues []string) []*dto.LabelPair + func MustRegister(cs ...Collector) + func NewPidFileFn(pidFilePath string) func() (int, error) + func Register(c Collector) error + func Unregister(c Collector) bool + func WriteToTextfile(filename string, g Gatherer) error + type AlreadyRegisteredError struct + ExistingCollector Collector + NewCollector Collector + func (err AlreadyRegisteredError) Error() string + type Collector interface + Collect func(chan<- Metric) + Describe func(chan<- *Desc) + func NewBuildInfoCollector() Collector + func NewExpvarCollector(exports map[string]*Desc) Collector + func NewGoCollector(opts ...func(o *internal.GoCollectorOptions)) Collector + func NewProcessCollector(opts ProcessCollectorOpts) Collector + type ConstrainableLabels interface + type ConstrainedLabel struct + Constraint func(string) string + Name string + func (cl ConstrainedLabel) Constrain(v string) string + type ConstrainedLabels []ConstrainedLabel + type Counter interface + Add func(float64) + Inc func() + func NewCounter(opts CounterOpts) Counter + type CounterFunc interface + func NewCounterFunc(opts CounterOpts, function func() float64) CounterFunc + type CounterOpts Opts + type CounterVec struct + func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec + func (v *CounterVec) CurryWith(labels Labels) (*CounterVec, error) + func (v *CounterVec) GetMetricWith(labels Labels) (Counter, error) + func (v *CounterVec) GetMetricWithLabelValues(lvs ...string) (Counter, error) + func (v *CounterVec) MustCurryWith(labels Labels) *CounterVec + func (v *CounterVec) With(labels Labels) Counter + func (v *CounterVec) WithLabelValues(lvs ...string) Counter + type CounterVecOpts struct + VariableLabels ConstrainableLabels + type Desc struct + func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) *Desc + func NewInvalidDesc(err error) *Desc + func (d *Desc) String() string + type Exemplar struct + Labels Labels + Timestamp time.Time + Value float64 + type ExemplarAdder interface + AddWithExemplar func(value float64, exemplar Labels) + type ExemplarObserver interface + ObserveWithExemplar func(value float64, exemplar Labels) + type Gatherer interface + Gather func() ([]*dto.MetricFamily, error) + type GathererFunc func() ([]*dto.MetricFamily, error) + func (gf GathererFunc) Gather() ([]*dto.MetricFamily, error) + type Gatherers []Gatherer + func (gs Gatherers) Gather() ([]*dto.MetricFamily, error) + type Gauge interface + Add func(float64) + Dec func() + Inc func() + Set func(float64) + SetToCurrentTime func() + Sub func(float64) + func NewGauge(opts GaugeOpts) Gauge + type GaugeFunc interface + func NewGaugeFunc(opts GaugeOpts, function func() float64) GaugeFunc + type GaugeOpts Opts + type GaugeVec struct + func NewGaugeVec(opts GaugeOpts, labelNames []string) *GaugeVec + func (v *GaugeVec) CurryWith(labels Labels) (*GaugeVec, error) + func (v *GaugeVec) GetMetricWith(labels Labels) (Gauge, error) + func (v *GaugeVec) GetMetricWithLabelValues(lvs ...string) (Gauge, error) + func (v *GaugeVec) MustCurryWith(labels Labels) *GaugeVec + func (v *GaugeVec) With(labels Labels) Gauge + func (v *GaugeVec) WithLabelValues(lvs ...string) Gauge + type GaugeVecOpts struct + VariableLabels ConstrainableLabels + type Histogram interface + Observe func(float64) + func NewHistogram(opts HistogramOpts) Histogram + type HistogramOpts struct + Buckets []float64 + ConstLabels Labels + Help string + Name string + Namespace string + NativeHistogramBucketFactor float64 + NativeHistogramMaxBucketNumber uint32 + NativeHistogramMaxZeroThreshold float64 + NativeHistogramMinResetDuration time.Duration + NativeHistogramZeroThreshold float64 + Subsystem string + type HistogramVec struct + func NewHistogramVec(opts HistogramOpts, labelNames []string) *HistogramVec + func (v *HistogramVec) CurryWith(labels Labels) (ObserverVec, error) + func (v *HistogramVec) GetMetricWith(labels Labels) (Observer, error) + func (v *HistogramVec) GetMetricWithLabelValues(lvs ...string) (Observer, error) + func (v *HistogramVec) MustCurryWith(labels Labels) ObserverVec + func (v *HistogramVec) With(labels Labels) Observer + func (v *HistogramVec) WithLabelValues(lvs ...string) Observer + type HistogramVecOpts struct + VariableLabels ConstrainableLabels + type Labels map[string]string + type Metric interface + Desc func() *Desc + Write func(*dto.Metric) error + func MustNewConstHistogram(desc *Desc, count uint64, sum float64, buckets map[float64]uint64, ...) Metric + func MustNewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues ...string) Metric + func MustNewConstSummary(desc *Desc, count uint64, sum float64, quantiles map[float64]float64, ...) Metric + func MustNewMetricWithExemplars(m Metric, exemplars ...Exemplar) Metric + func NewConstHistogram(desc *Desc, count uint64, sum float64, buckets map[float64]uint64, ...) (Metric, error) + func NewConstMetric(desc *Desc, valueType ValueType, value float64, labelValues ...string) (Metric, error) + func NewConstSummary(desc *Desc, count uint64, sum float64, quantiles map[float64]float64, ...) (Metric, error) + func NewInvalidMetric(desc *Desc, err error) Metric + func NewMetricWithExemplars(m Metric, exemplars ...Exemplar) (Metric, error) + func NewMetricWithTimestamp(t time.Time, m Metric) Metric + type MetricVec struct + func NewMetricVec(desc *Desc, newMetric func(lvs ...string) Metric) *MetricVec + func (m *MetricVec) Collect(ch chan<- Metric) + func (m *MetricVec) CurryWith(labels Labels) (*MetricVec, error) + func (m *MetricVec) Delete(labels Labels) bool + func (m *MetricVec) DeleteLabelValues(lvs ...string) bool + func (m *MetricVec) DeletePartialMatch(labels Labels) int + func (m *MetricVec) Describe(ch chan<- *Desc) + func (m *MetricVec) GetMetricWith(labels Labels) (Metric, error) + func (m *MetricVec) GetMetricWithLabelValues(lvs ...string) (Metric, error) + func (m *MetricVec) Reset() + type MultiError []error + func (errs *MultiError) Append(err error) + func (errs MultiError) Error() string + func (errs MultiError) MaybeUnwrap() error + type MultiTRegistry struct + func NewMultiTRegistry(tGatherers ...TransactionalGatherer) *MultiTRegistry + func (r *MultiTRegistry) Gather() (mfs []*dto.MetricFamily, done func(), err error) + type Observer interface + Observe func(float64) + type ObserverFunc func(float64) + func (f ObserverFunc) Observe(value float64) + type ObserverVec interface + CurryWith func(Labels) (ObserverVec, error) + GetMetricWith func(Labels) (Observer, error) + GetMetricWithLabelValues func(lvs ...string) (Observer, error) + MustCurryWith func(Labels) ObserverVec + With func(Labels) Observer + WithLabelValues func(...string) Observer + type Opts struct + ConstLabels Labels + Help string + Name string + Namespace string + Subsystem string + type ProcessCollectorOpts struct + Namespace string + PidFn func() (int, error) + ReportErrors bool + type Registerer interface + MustRegister func(...Collector) + Register func(Collector) error + Unregister func(Collector) bool + func WrapRegistererWith(labels Labels, reg Registerer) Registerer + func WrapRegistererWithPrefix(prefix string, reg Registerer) Registerer + type Registry struct + func NewPedanticRegistry() *Registry + func NewRegistry() *Registry + func (r *Registry) Collect(ch chan<- Metric) + func (r *Registry) Describe(ch chan<- *Desc) + func (r *Registry) Gather() ([]*dto.MetricFamily, error) + func (r *Registry) MustRegister(cs ...Collector) + func (r *Registry) Register(c Collector) error + func (r *Registry) Unregister(c Collector) bool + type Summary interface + Observe func(float64) + func NewSummary(opts SummaryOpts) Summary + type SummaryOpts struct + AgeBuckets uint32 + BufCap uint32 + ConstLabels Labels + Help string + MaxAge time.Duration + Name string + Namespace string + Objectives map[float64]float64 + Subsystem string + type SummaryVec struct + func NewSummaryVec(opts SummaryOpts, labelNames []string) *SummaryVec + func (v *SummaryVec) CurryWith(labels Labels) (ObserverVec, error) + func (v *SummaryVec) GetMetricWith(labels Labels) (Observer, error) + func (v *SummaryVec) GetMetricWithLabelValues(lvs ...string) (Observer, error) + func (v *SummaryVec) MustCurryWith(labels Labels) ObserverVec + func (v *SummaryVec) With(labels Labels) Observer + func (v *SummaryVec) WithLabelValues(lvs ...string) Observer + type SummaryVecOpts struct + VariableLabels ConstrainableLabels + type Timer struct + func NewTimer(o Observer) *Timer + func (t *Timer) ObserveDuration() time.Duration + func (t *Timer) ObserveDurationWithExemplar(exemplar Labels) time.Duration + type TransactionalGatherer interface + Gather func() (_ []*dto.MetricFamily, done func(), err error) + func ToTransactionalGatherer(g Gatherer) TransactionalGatherer + type UnconstrainedLabels []string + type UntypedFunc interface + func NewUntypedFunc(opts UntypedOpts, function func() float64) UntypedFunc + type UntypedOpts Opts + type ValueType int + const CounterValue + const GaugeValue + const UntypedValue + func (v ValueType) ToDTO() *dto.MetricType