Documentation ¶
Overview ¶
Package publisher implements github.com/the-anna-project/instrumentor.Publisher and provides instrumentation primitives to emit application metrics.
Index ¶
- func IsInvalidConfig(err error) bool
- type Counter
- type CounterConfig
- type Gauge
- func (g *Gauge) Decrement(delta float64) error
- func (g *Gauge) DecrementWithLabels(delta float64, values ...string) error
- func (g *Gauge) Increment(delta float64) error
- func (g *Gauge) IncrementWithLabels(delta float64, values ...string) error
- func (g *Gauge) Set(value float64) error
- func (g *Gauge) SetWithLabels(value float64, values ...string) error
- type GaugeConfig
- type Histogram
- type HistogramConfig
- func (hc *HistogramConfig) Buckets() []float64
- func (hc *HistogramConfig) Help() string
- func (hc *HistogramConfig) Labels() []string
- func (hc *HistogramConfig) Name() string
- func (hc *HistogramConfig) SetBuckets(buckets []float64)
- func (hc *HistogramConfig) SetHelp(help string)
- func (hc *HistogramConfig) SetLabels(labels []string)
- func (hc *HistogramConfig) SetName(name string)
- type Service
- func (s *Service) Boot()
- func (s *Service) Counter(config spec.CounterConfig) (spec.Counter, error)
- func (s *Service) CounterConfig() spec.CounterConfig
- func (s *Service) Gauge(config spec.GaugeConfig) (spec.Gauge, error)
- func (s *Service) GaugeConfig() spec.GaugeConfig
- func (s *Service) HTTPEndpoint() string
- func (s *Service) HTTPHandler() http.Handler
- func (s *Service) Histogram(config spec.HistogramConfig) (spec.Histogram, error)
- func (s *Service) HistogramConfig() spec.HistogramConfig
- func (s *Service) NewKey(str ...string) string
- func (s *Service) Prefixes() []string
- func (s *Service) Shutdown()
- func (s *Service) WrapFunc(key string, action func() error) func() error
- type ServiceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
Types ¶
type Counter ¶
type Counter struct { // Public. ClientCounter prometheus.Counter ClientCounterVec *prometheus.CounterVec }
func NewCounter ¶
func NewCounter(config spec.CounterConfig) (*Counter, error)
NewCounter creates a new configured prometheus publisher counter object.
type CounterConfig ¶
type CounterConfig struct {
// contains filtered or unexported fields
}
CounterConfig represents the configuration used to create a new prometheus publisher counter object.
func DefaultCounterConfig ¶
func DefaultCounterConfig() *CounterConfig
DefaultCounterConfig provides a default configuration to create a new prometheus publisher counter object by best effort.
func (*CounterConfig) Help ¶
func (cc *CounterConfig) Help() string
func (*CounterConfig) Labels ¶
func (cc *CounterConfig) Labels() []string
func (*CounterConfig) Name ¶
func (cc *CounterConfig) Name() string
func (*CounterConfig) SetHelp ¶
func (cc *CounterConfig) SetHelp(help string)
func (*CounterConfig) SetLabels ¶
func (cc *CounterConfig) SetLabels(labels []string)
func (*CounterConfig) SetName ¶
func (cc *CounterConfig) SetName(name string)
type Gauge ¶
type Gauge struct { // Public. ClientGauge prometheus.Gauge ClientGaugeVec *prometheus.GaugeVec }
func NewGauge ¶
func NewGauge(config spec.GaugeConfig) (*Gauge, error)
NewGauge creates a new configured prometheus publisher gauge.
func (*Gauge) DecrementWithLabels ¶
func (*Gauge) IncrementWithLabels ¶
type GaugeConfig ¶
type GaugeConfig struct {
// contains filtered or unexported fields
}
GaugeConfig represents the configuration used to create a new prometheus publisher gauge.
func DefaultGaugeConfig ¶
func DefaultGaugeConfig() *GaugeConfig
DefaultGaugeConfig provides a default configuration to create a new prometheus publisher gauge by best effort.
func (*GaugeConfig) Help ¶
func (gc *GaugeConfig) Help() string
func (*GaugeConfig) Labels ¶
func (gc *GaugeConfig) Labels() []string
func (*GaugeConfig) Name ¶
func (gc *GaugeConfig) Name() string
func (*GaugeConfig) SetHelp ¶
func (gc *GaugeConfig) SetHelp(help string)
func (*GaugeConfig) SetLabels ¶
func (gc *GaugeConfig) SetLabels(labels []string)
func (*GaugeConfig) SetName ¶
func (gc *GaugeConfig) SetName(name string)
type Histogram ¶
type Histogram struct { // Public. ClientHistogram prometheus.Histogram ClientHistogramVec *prometheus.HistogramVec }
func NewHistogram ¶
func NewHistogram(config spec.HistogramConfig) (*Histogram, error)
NewHistogram creates a new configured prometheus publisher histogram.
type HistogramConfig ¶
type HistogramConfig struct {
// contains filtered or unexported fields
}
HistogramConfig represents the configuration used to create a new prometheus publisher histogram.
func DefaultHistogramConfig ¶
func DefaultHistogramConfig() *HistogramConfig
DefaultHistogramConfig provides a default configuration to create a new prometheus publisher histogram by best effort.
func (*HistogramConfig) Buckets ¶
func (hc *HistogramConfig) Buckets() []float64
func (*HistogramConfig) Help ¶
func (hc *HistogramConfig) Help() string
func (*HistogramConfig) Labels ¶
func (hc *HistogramConfig) Labels() []string
func (*HistogramConfig) Name ¶
func (hc *HistogramConfig) Name() string
func (*HistogramConfig) SetBuckets ¶
func (hc *HistogramConfig) SetBuckets(buckets []float64)
func (*HistogramConfig) SetHelp ¶
func (hc *HistogramConfig) SetHelp(help string)
func (*HistogramConfig) SetLabels ¶
func (hc *HistogramConfig) SetLabels(labels []string)
func (*HistogramConfig) SetName ¶
func (hc *HistogramConfig) SetName(name string)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(config ServiceConfig) (*Service, error)
NewService creates a new prometheus publisher service.
func (*Service) CounterConfig ¶
func (s *Service) CounterConfig() spec.CounterConfig
func (*Service) GaugeConfig ¶
func (s *Service) GaugeConfig() spec.GaugeConfig
func (*Service) HTTPEndpoint ¶
func (*Service) HTTPHandler ¶
func (*Service) HistogramConfig ¶
func (s *Service) HistogramConfig() spec.HistogramConfig
type ServiceConfig ¶
type ServiceConfig struct { // Settings. HTTPEndpoint string HTTPHandler http.Handler Prefixes []string }
ServiceConfig represents the configuration used to create a new prometheus publisher service.
func DefaultServiceConfig ¶
func DefaultServiceConfig() ServiceConfig
DefaultServiceConfig provides a default configuration to create a new prometheus publisher service by best effort.