Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Counter ¶
A Counter is a monotonically-increasing integer expvar associated with a set of labels expressed as a key-value string map.
Note that exporting custom labels for Counters to Stackdriver is only implemented for counters that are part of a CounterMap.
func NewCounter ¶
func NewCounter(mp MetricPrefix, name string) *Counter
NewCounter creates and exports a new Counter for the MetricPrefix.
type CounterMap ¶
A CounterMap is used to export a set of related Counters which have the same label keys.
func NewCounterMap ¶
func NewCounterMap(mp MetricPrefix, name string, labelKeys ...string) *CounterMap
NewCounterMap creates and exports a new CounterMap for the MetricPrefix.
func (*CounterMap) Counter ¶
func (cm *CounterMap) Counter(labelValues ...string) (*Counter, error)
Counter retrieves or creates a Counter with a given set of label values.
func (*CounterMap) MustCounter ¶
func (cm *CounterMap) MustCounter(labelValues ...string) *Counter
MustCounter is a version of Counter that panics on error, for use in init functions.
type MetricPrefix ¶
type MetricPrefix string
A MetricPrefix is a path element prepended to metric names.
const Nozzle MetricPrefix = "stackdriver-nozzle"
Nozzle is the prefix under which the nozzle exports metrics about its own operation. It's created here because metrics will be created in many places throughout the Nozzle's code base.
func (MetricPrefix) Qualify ¶
func (mp MetricPrefix) Qualify(name string) string
Qualify returns the metric name prepended by the metric prefix and "/".
type Reporter ¶
Reporter aggregates telemetry registered with expvar and reports it to Sink endpoints
type Sink ¶
type Sink interface { // Init is called a single time when the Reporter is starting before any data is reported Init([]*expvar.KeyValue) // Report is a snapshot of the cumulative telemetry values at the current time Report([]*expvar.KeyValue) }
Sink represents an endpoint that records telemetry to an external source
func NewLogSink ¶
NewLogSink provides a Sink that writes Reports to a lager.Logger