Documentation ¶
Index ¶
- Variables
- type PrometheusOpts
- type PrometheusPushSink
- type PrometheusSink
- func (p *PrometheusSink) AddSample(parts []string, val float32)
- func (p *PrometheusSink) AddSampleWithLabels(parts []string, val float32, labels []metrics.Label)
- func (p *PrometheusSink) Collect(c chan<- prometheus.Metric)
- func (p *PrometheusSink) Describe(c chan<- *prometheus.Desc)
- func (p *PrometheusSink) EmitKey(key []string, val float32)
- func (p *PrometheusSink) IncrCounter(parts []string, val float32)
- func (p *PrometheusSink) IncrCounterWithLabels(parts []string, val float32, labels []metrics.Label)
- func (p *PrometheusSink) SetGauge(parts []string, val float32)
- func (p *PrometheusSink) SetGaugeWithLabels(parts []string, val float32, labels []metrics.Label)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultPrometheusOpts is the default set of options used when creating a // PrometheusSink. DefaultPrometheusOpts = PrometheusOpts{ Expiration: 60 * time.Second, } )
Functions ¶
This section is empty.
Types ¶
type PrometheusOpts ¶
type PrometheusOpts struct { // Expiration is the duration a metric is valid for, after which it will be // untracked. If the value is zero, a metric is never expired. Expiration time.Duration }
PrometheusOpts is used to configure the Prometheus Sink
type PrometheusPushSink ¶
type PrometheusPushSink struct { *PrometheusSink // contains filtered or unexported fields }
func NewPrometheusPushSink ¶
func (*PrometheusPushSink) Shutdown ¶
func (s *PrometheusPushSink) Shutdown()
type PrometheusSink ¶
type PrometheusSink struct {
// contains filtered or unexported fields
}
func NewPrometheusSink ¶
func NewPrometheusSink() (*PrometheusSink, error)
NewPrometheusSink creates a new PrometheusSink using the default options.
func NewPrometheusSinkFrom ¶
func NewPrometheusSinkFrom(opts PrometheusOpts) (*PrometheusSink, error)
NewPrometheusSinkFrom creates a new PrometheusSink using the passed options.
func (*PrometheusSink) AddSample ¶
func (p *PrometheusSink) AddSample(parts []string, val float32)
func (*PrometheusSink) AddSampleWithLabels ¶
func (p *PrometheusSink) AddSampleWithLabels(parts []string, val float32, labels []metrics.Label)
func (*PrometheusSink) Collect ¶
func (p *PrometheusSink) Collect(c chan<- prometheus.Metric)
Collect meets the collection interface and allows us to enforce our expiration logic to clean up ephemeral metrics if their value haven't been set for a duration exceeding our allowed expiration time.
func (*PrometheusSink) Describe ¶
func (p *PrometheusSink) Describe(c chan<- *prometheus.Desc)
Describe is needed to meet the Collector interface.
func (*PrometheusSink) EmitKey ¶
func (p *PrometheusSink) EmitKey(key []string, val float32)
EmitKey is not implemented. Prometheus doesn’t offer a type for which an arbitrary number of values is retained, as Prometheus works with a pull model, rather than a push model.
func (*PrometheusSink) IncrCounter ¶
func (p *PrometheusSink) IncrCounter(parts []string, val float32)
func (*PrometheusSink) IncrCounterWithLabels ¶
func (p *PrometheusSink) IncrCounterWithLabels(parts []string, val float32, labels []metrics.Label)
func (*PrometheusSink) SetGauge ¶
func (p *PrometheusSink) SetGauge(parts []string, val float32)
func (*PrometheusSink) SetGaugeWithLabels ¶
func (p *PrometheusSink) SetGaugeWithLabels(parts []string, val float32, labels []metrics.Label)
Click to show internal directories.
Click to hide internal directories.