Documentation ¶
Overview ¶
Package meter is for instrumentation
Index ¶
- Variables
- func NewContext(ctx context.Context, c Meter) context.Context
- type Counter
- type FloatCounter
- type Gauge
- type Histogram
- type LabelIter
- type Labels
- type Meter
- type Option
- func Address(value string) Option
- func Context(ctx context.Context) Option
- func Label(key, val string) Option
- func Logger(l logger.Logger) Option
- func Name(n string) Option
- func Path(value string) Option
- func SetOption(k, v interface{}) Option
- func WriteFDMetrics(b bool) Option
- func WriteProcessMetrics(b bool) Option
- type Options
- type Summary
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" // DefaultMetricPrefix holds the string that prepends to all metrics DefaultMetricPrefix = "micro_" // DefaultLabelPrefix holds the string that prepends to all labels DefaultLabelPrefix = "micro_" // DefaultSummaryQuantiles is the default spread of stats for summary DefaultSummaryQuantiles = []float64{0.5, 0.9, 0.97, 0.99, 1} // DefaultSummaryWindow is the default window for summary DefaultSummaryWindow = 5 * time.Minute )
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
}
LabelIter holds the
type Labels ¶ added in v3.1.9
type Labels struct {
// contains filtered or unexported fields
}
Labels holds the metrics labels with k, v
type Meter ¶ added in v3.1.4
type Meter interface { Name() string Init(opts ...Option) error Counter(name string, opts ...Option) Counter FloatCounter(name string, opts ...Option) FloatCounter Gauge(name string, fn func() float64, opts ...Option) Gauge Set(opts ...Option) Meter Histogram(name string, opts ...Option) Histogram Summary(name string, opts ...Option) Summary SummaryExt(name string, window time.Duration, quantiles []float64, opts ...Option) Summary Write(w io.Writer, opts ...Option) 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:
func SetOption ¶ added in v3.1.5
func SetOption(k, v interface{}) Option
SetOption returns a function to setup a context with given value
func WriteFDMetrics ¶ added in v3.2.12
WriteFDMetrics enable fd metrics output for write
func WriteProcessMetrics ¶ added in v3.2.12
WriteProcessMetrics enable process metrics output for write
Click to show internal directories.
Click to hide internal directories.