Documentation
¶
Index ¶
- func Duration(sink Sink, name string, start time.Time, tags ...Tag)
- func Shutdown()
- type FanoutSink
- func (f FanoutSink) Close() error
- func (f FanoutSink) Counter(name string, val float32, tags ...Tag)
- func (f FanoutSink) Gauge(name string, val float32, tags ...Tag)
- func (f FanoutSink) Rate(name string, val float32, tags ...Tag)
- func (f FanoutSink) Store(name string, val float32, tags ...Tag)
- func (f FanoutSink) Timer(name string, val float32, tags ...Tag)
- type GoMetricsSink
- func (g *GoMetricsSink) Close() error
- func (g *GoMetricsSink) Counter(name string, val float32, tags ...Tag)
- func (g *GoMetricsSink) Gauge(name string, val float32, tags ...Tag)
- func (g *GoMetricsSink) PrometheusEnabled() bool
- func (g *GoMetricsSink) Rate(name string, val float32, tags ...Tag)
- func (g *GoMetricsSink) Store(name string, val float32, tags ...Tag)
- func (g *GoMetricsSink) Timer(name string, val float32, tags ...Tag)
- type NoopSink
- type Sink
- type Tag
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FanoutSink ¶
type FanoutSink []Sink
FanoutSink fans out every emission to all constituent sinks.
func (FanoutSink) Close ¶
func (f FanoutSink) Close() error
type GoMetricsSink ¶
type GoMetricsSink struct {
// contains filtered or unexported fields
}
GoMetricsSink wraps the hashicorp/go-metrics global instance, giving access to all open-source backends (StatsD, Statsite, Prometheus, Circonus, DogStatsD, Stackdriver) through a single Sink.
func NewGoMetricsSink ¶
func NewGoMetricsSink(serviceName string, disableHostname bool, fanout goMetrics.FanoutSink) (*GoMetricsSink, error)
NewGoMetricsSink creates the hashicorp/go-metrics global instance from the supplied fanout sinks and config.
func (*GoMetricsSink) Close ¶
func (g *GoMetricsSink) Close() error
func (*GoMetricsSink) Counter ¶
func (g *GoMetricsSink) Counter(name string, val float32, tags ...Tag)
func (*GoMetricsSink) PrometheusEnabled ¶
func (g *GoMetricsSink) PrometheusEnabled() bool
PrometheusEnabled reports whether a Prometheus sink was configured.
type Sink ¶
type Sink interface {
Counter(name string, val float32, tags ...Tag)
Gauge(name string, val float32, tags ...Tag)
Timer(name string, val float32, tags ...Tag)
// Store records an arbitrary numeric observation.
// Backends that lack a native store type should delegate to Gauge.
Store(name string, val float32, tags ...Tag)
// Rate records a rate observation.
// Backends that lack a native rate type should delegate to Counter.
Rate(name string, val float32, tags ...Tag)
Close() error
}
Sink is the interface that every metrics backend must implement. Name is a dot-separated metric path (e.g. "console.request.count").
Emitter is the package-level default Sink. It is set by Setup and read by call sites throughout the application.