Documentation
¶
Overview ¶
Package spectator provides a minimal Go implementation of the Netflix Java Spectator library. The goal of this package is to allow Go programs to emit metrics to Atlas.
Please refer to the Java Spectator documentation for information on spectator / Atlas fundamentals: https://netflix.github.io/spectator/en/latest/
Index ¶
- type Config
- type Meter
- type Registry
- func (r *Registry) AgeGauge(name string, tags map[string]string) *meter.AgeGauge
- func (r *Registry) AgeGaugeWithId(id *meter.Id) *meter.AgeGauge
- func (r *Registry) Close()
- func (r *Registry) Counter(name string, tags map[string]string) *meter.Counter
- func (r *Registry) CounterWithId(id *meter.Id) *meter.Counter
- func (r *Registry) DistributionSummary(name string, tags map[string]string) *meter.DistributionSummary
- func (r *Registry) DistributionSummaryWithId(id *meter.Id) *meter.DistributionSummary
- func (r *Registry) Gauge(name string, tags map[string]string) *meter.Gauge
- func (r *Registry) GaugeWithId(id *meter.Id) *meter.Gauge
- func (r *Registry) GaugeWithIdWithTTL(id *meter.Id, duration time.Duration) *meter.Gauge
- func (r *Registry) GaugeWithTTL(name string, tags map[string]string, duration time.Duration) *meter.Gauge
- func (r *Registry) GetLogger() logger.Logger
- func (r *Registry) MaxGauge(name string, tags map[string]string) *meter.MaxGauge
- func (r *Registry) MaxGaugeWithId(id *meter.Id) *meter.MaxGauge
- func (r *Registry) MonotonicCounter(name string, tags map[string]string) *meter.MonotonicCounter
- func (r *Registry) MonotonicCounterWithId(id *meter.Id) *meter.MonotonicCounter
- func (r *Registry) NewId(name string, tags map[string]string) *meter.Id
- func (r *Registry) PercentileDistributionSummary(name string, tags map[string]string) *meter.PercentileDistributionSummary
- func (r *Registry) PercentileDistributionSummaryWithId(id *meter.Id) *meter.PercentileDistributionSummary
- func (r *Registry) PercentileTimer(name string, tags map[string]string) *meter.PercentileTimer
- func (r *Registry) PercentileTimerWithId(id *meter.Id) *meter.PercentileTimer
- func (r *Registry) SetLogger(logger logger.Logger)
- func (r *Registry) Timer(name string, tags map[string]string) *meter.Timer
- func (r *Registry) TimerWithId(id *meter.Id) *meter.Timer
- type RegistryInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Location string `json:"sidecar.output-location"` CommonTags map[string]string `json:"sidecar.common-tags"` Log logger.Logger }
Config represents the Registry's configuration.
func (*Config) GetLocation ¶
GetLocation Checks the location provided in the config and the environment variable SPECTATOR_OUTPUT_LOCATION. If neither are valid, returns the default UDP address.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the collection of meters being reported.
func NewRegistry ¶
NewRegistry generates a new registry from the config.
If config.Log is unset, it defaults to using the default logger.
func NewRegistryConfiguredBy ¶
NewRegistryConfiguredBy loads a new Config JSON file from disk at the path specified.
func (*Registry) AgeGaugeWithId ¶ added in v1.1.1
func (*Registry) Counter ¶
Counter calls NewId() with the name and tags, and then calls r.CounterWithId() using that *Id.
func (*Registry) DistributionSummary ¶
func (*Registry) DistributionSummaryWithId ¶
func (r *Registry) DistributionSummaryWithId(id *meter.Id) *meter.DistributionSummary
func (*Registry) GaugeWithIdWithTTL ¶
func (*Registry) GaugeWithTTL ¶
func (*Registry) MonotonicCounter ¶ added in v1.1.1
MonotonicCounter calls NewId() with the name and tags, and then calls r.MonotonicCounterWithId() using that *Id.
func (*Registry) MonotonicCounterWithId ¶ added in v1.1.1
func (r *Registry) MonotonicCounterWithId(id *meter.Id) *meter.MonotonicCounter
func (*Registry) NewId ¶
NewId calls meters.NewId() and adds the CommonTags registered in the config.
func (*Registry) PercentileDistributionSummary ¶
func (*Registry) PercentileDistributionSummaryWithId ¶
func (r *Registry) PercentileDistributionSummaryWithId(id *meter.Id) *meter.PercentileDistributionSummary
func (*Registry) PercentileTimer ¶
func (*Registry) PercentileTimerWithId ¶
func (r *Registry) PercentileTimerWithId(id *meter.Id) *meter.PercentileTimer
type RegistryInterface ¶
type RegistryInterface interface { GetLogger() logger.Logger SetLogger(logger logger.Logger) NewId(name string, tags map[string]string) *meter.Id Counter(name string, tags map[string]string) *meter.Counter CounterWithId(id *meter.Id) *meter.Counter MonotonicCounter(name string, tags map[string]string) *meter.MonotonicCounter MonotonicCounterWithId(id *meter.Id) *meter.MonotonicCounter Timer(name string, tags map[string]string) *meter.Timer TimerWithId(id *meter.Id) *meter.Timer Gauge(name string, tags map[string]string) *meter.Gauge GaugeWithId(id *meter.Id) *meter.Gauge GaugeWithTTL(name string, tags map[string]string, ttl time.Duration) *meter.Gauge GaugeWithIdWithTTL(id *meter.Id, ttl time.Duration) *meter.Gauge AgeGauge(name string, tags map[string]string) *meter.AgeGauge AgeGaugeWithId(id *meter.Id) *meter.AgeGauge MaxGauge(name string, tags map[string]string) *meter.MaxGauge MaxGaugeWithId(id *meter.Id) *meter.MaxGauge DistributionSummary(name string, tags map[string]string) *meter.DistributionSummary DistributionSummaryWithId(id *meter.Id) *meter.DistributionSummary PercentileDistributionSummary(name string, tags map[string]string) *meter.PercentileDistributionSummary PercentileDistributionSummaryWithId(id *meter.Id) *meter.PercentileDistributionSummary PercentileTimer(name string, tags map[string]string) *meter.PercentileTimer PercentileTimerWithId(id *meter.Id) *meter.PercentileTimer Close() }