Documentation ¶
Overview ¶
Package meter is for instrumentation
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultMeter is the default meter DefaultMeter Meter = NewMeter() // DefaultAddress data will be made available on this host:port DefaultAddress = ":9090" // DefaultPath the meter endpoint where the Meter data will be made available DefaultPath = "/metrics" // timingObjectives is the default spread of stats we maintain for timings / histograms: //defaultTimingObjectives = map[float64]float64{0.0: 0, 0.5: 0.05, 0.75: 0.04, 0.90: 0.03, 0.95: 0.02, 0.98: 0.001, 1: 0} // default metric prefix DefaultMetricPrefix = "micro_" // default label prefix DefaultLabelPrefix = "micro_" )
Functions ¶
Types ¶
type FloatCounter ¶ added in v3.1.4
FloatCounter is a float64 counter
type Histogram ¶ added in v3.1.4
Histogram is a histogram for non-negative values with automatically created buckets
type LabelIter ¶ added in v3.1.9
type LabelIter struct {
// contains filtered or unexported fields
}
type Meter ¶ added in v3.1.4
type Meter interface { Name() string Init(...Option) error Counter(string, ...Option) Counter FloatCounter(string, ...Option) FloatCounter Gauge(string, func() float64, ...Option) Gauge Set(...Option) Meter Histogram(string, ...Option) Histogram Summary(string, ...Option) Summary SummaryExt(string, time.Duration, []float64, ...Option) Summary Write(io.Writer, bool) error Options() Options String() string }
Meter is an interface for collecting and instrumenting metrics
func FromContext ¶ added in v3.1.5
FromContext get meter from context
type Option ¶
type Option func(*Options)
Option powers the configuration for metrics implementations:
Click to show internal directories.
Click to hide internal directories.