metrics

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Index

Constants

View Source
const (
	MetricTypeGauge     = "Gauge"
	MetricTypeCounter   = "Counter"
	MetricTypeHistogram = "Histogram"
	MetricTypeSummary   = "Summary"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Metric

type Metric struct {
	Type             MetricType
	Name             string
	Help             string
	Value            float64
	Labels           map[string]string
	HistogramBuckets []float64
	Time             time.Time
}

type MetricRecorder

type MetricRecorder struct {
	Logger    *zap.SugaredLogger
	Project   string
	Cluster   string
	Slice     string
	Namespace string
	Subsystem string
}

MetricRecorder provides a container with config parameters for the Prometheus Exporter

func (*MetricRecorder) Copy

func (mr *MetricRecorder) Copy() *MetricRecorder

Copy returns a Provider that produces Prometheus metrics. Namespace and subsystem are applied to all produced metrics.

func (*MetricRecorder) RecordMetric

func (mr *MetricRecorder) RecordMetric(ctx context.Context, m *Metric) error

RecordMetric records a metric to the Prometheus Exporter

type MetricType

type MetricType string

Jump to

Keyboard shortcuts

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