Documentation ¶
Index ¶
- Constants
- Variables
- func NormaliseAndLowercaseName(name string) string
- type CounterFacade
- type DecGaugeByValue
- type ErrorCounter
- type GaugeFacade
- type HistogramFacade
- type IncByValue
- type IncGaugeByValue
- type LabelledCounterFacade
- type LabelledGaugeFacade
- type LabelledSummaryFacade
- type LabelsMap
- type MetricBuilder
- type MetricDescriptions
- type MetricOpts
- type MetricRegistrations
- type PrometheusMetrics
- type PrometheusMetricsImpl
- func (p *PrometheusMetricsImpl) Counter(name string, optionalDesc ...string) CounterFacade
- func (p *PrometheusMetricsImpl) CounterWithLabel(name string, labelName string, optionalDesc ...string) LabelledCounterFacade
- func (p *PrometheusMetricsImpl) CounterWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledCounterFacade
- func (p *PrometheusMetricsImpl) Error(name string) ErrorCounter
- func (p *PrometheusMetricsImpl) Gauge(name string, optionalDesc ...string) GaugeFacade
- func (p *PrometheusMetricsImpl) GaugeWithLabel(name string, labelName string, optionalDesc ...string) LabelledGaugeFacade
- func (p *PrometheusMetricsImpl) GaugeWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledGaugeFacade
- func (p *PrometheusMetricsImpl) Histogram(name string, buckets []float64, optionalDesc ...string) HistogramFacade
- func (p *PrometheusMetricsImpl) HistogramForResponseTime(name string, optionalDesc ...string) HistogramFacade
- func (p *PrometheusMetricsImpl) MustRegister(metric prometheus.Collector)
- func (p *PrometheusMetricsImpl) Register(metric prometheus.Collector) error
- func (p *PrometheusMetricsImpl) Summary(name string, optionalDesc ...string) SummaryFacade
- func (p *PrometheusMetricsImpl) SummaryWithLabel(name string, labelName string, optionalDesc ...string) LabelledSummaryFacade
- func (p *PrometheusMetricsImpl) SummaryWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledSummaryFacade
- func (p *PrometheusMetricsImpl) TestHelper() *TestHelper
- func (p *PrometheusMetricsImpl) Timer(Name string) func() time.Duration
- func (p *PrometheusMetricsImpl) TimerWithLabel(Name string, labelName string, labelValue string) func() time.Duration
- func (p *PrometheusMetricsImpl) TimerWithLabels(Name string, labelNames []string, labelValues []string) func() time.Duration
- type SetGaugeByValue
- type SummaryFacade
- type TestHelper
- func (h *TestHelper) Clear()
- func (h *TestHelper) Gather() ([]*clientmodel.MetricFamily, error)
- func (h *TestHelper) GetMetricFamily(metrics []*clientmodel.MetricFamily, name string) (*clientmodel.MetricFamily, error)
- func (h *TestHelper) GetMetricLabelValues(name string) LabelsMap
- func (h *TestHelper) MetricNames() []string
Constants ¶
Variables ¶
View Source
var DefaultBuckets = prometheus.DefBuckets
View Source
var (
DefaultObjectives = map[float64]float64{0.5: 0.01, 0.75: 0.01, 0.9: 0.01, 0.95: 0.01, 0.99: 0.01, 0.999: 0.01}
)
Functions ¶
Types ¶
type CounterFacade ¶
type CounterFacade interface { Inc() IncBy(inc float64) }
type DecGaugeByValue ¶ added in v1.2.0
type DecGaugeByValue interface {
Value(inc float64)
}
type ErrorCounter ¶
type ErrorCounter struct {
// contains filtered or unexported fields
}
type GaugeFacade ¶
type HistogramFacade ¶
type HistogramFacade interface {
Update(value float64)
}
type IncByValue ¶
type IncByValue interface {
Value(inc float64)
}
type IncGaugeByValue ¶ added in v1.2.0
type IncGaugeByValue interface {
Value(inc float64)
}
type LabelledCounterFacade ¶
type LabelledCounterFacade interface { IncLabel(labelValues ...string) IncLabelBy(labelValues ...string) IncByValue }
type LabelledGaugeFacade ¶ added in v1.2.0
type LabelledGaugeFacade interface { IncLabels(labelValues ...string) IncLabelsBy(labelValues ...string) IncGaugeByValue DecLabels(labelValues ...string) DecLabelsBy(labelValues ...string) DecGaugeByValue SetLabels(labelValues ...string) SetGaugeByValue }
type LabelledSummaryFacade ¶ added in v1.1.0
type LabelledSummaryFacade struct {
// contains filtered or unexported fields
}
func (LabelledSummaryFacade) Observe ¶ added in v1.1.0
func (f LabelledSummaryFacade) Observe(value float64, labelValues ...string)
type MetricBuilder ¶
type MetricBuilder func(p *PrometheusMetricsImpl, name string, desc string) interface{}
type MetricDescriptions ¶
type MetricOpts ¶
type MetricOpts struct { Registry prometheus.Registerer MetricNamePrefix string PrefixSeparator string Descriptions MetricDescriptions CaseSensitiveMetricNames bool // true is faster, default is Insensitive }
type MetricRegistrations ¶
type PrometheusMetrics ¶
type PrometheusMetrics interface { Register(metric prometheus.Collector) error MustRegister(metric prometheus.Collector) TestHelper() *TestHelper Counter(name string, optionalDesc ...string) CounterFacade CounterWithLabel(name string, labelName string, optionalDesc ...string) LabelledCounterFacade CounterWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledCounterFacade Error(name string) ErrorCounter Gauge(name string, optionalDesc ...string) GaugeFacade GaugeWithLabel(name string, labelName string, optionalDesc ...string) LabelledGaugeFacade GaugeWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledGaugeFacade Histogram(name string, buckets []float64, optionalDesc ...string) HistogramFacade HistogramForResponseTime(name string, optionalDesc ...string) HistogramFacade Summary(name string, optionalDesc ...string) SummaryFacade SummaryWithLabel(name string, labelName string, optionalDesc ...string) LabelledSummaryFacade SummaryWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledSummaryFacade Timer(Name string) func() time.Duration TimerWithLabel(Name string, labelName string, labelValue string) func() time.Duration TimerWithLabels(Name string, labelNames []string, labelValues []string) func() time.Duration }
type PrometheusMetricsImpl ¶ added in v1.1.0
type PrometheusMetricsImpl struct {
// contains filtered or unexported fields
}
func NewMetrics ¶
func NewMetrics(opts MetricOpts) PrometheusMetricsImpl
func (*PrometheusMetricsImpl) Counter ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) Counter(name string, optionalDesc ...string) CounterFacade
func (*PrometheusMetricsImpl) CounterWithLabel ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) CounterWithLabel(name string, labelName string, optionalDesc ...string) LabelledCounterFacade
func (*PrometheusMetricsImpl) CounterWithLabels ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) CounterWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledCounterFacade
func (*PrometheusMetricsImpl) Error ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) Error(name string) ErrorCounter
func (*PrometheusMetricsImpl) Gauge ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) Gauge(name string, optionalDesc ...string) GaugeFacade
func (*PrometheusMetricsImpl) GaugeWithLabel ¶ added in v1.2.0
func (p *PrometheusMetricsImpl) GaugeWithLabel(name string, labelName string, optionalDesc ...string) LabelledGaugeFacade
func (*PrometheusMetricsImpl) GaugeWithLabels ¶ added in v1.2.0
func (p *PrometheusMetricsImpl) GaugeWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledGaugeFacade
func (*PrometheusMetricsImpl) Histogram ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) Histogram(name string, buckets []float64, optionalDesc ...string) HistogramFacade
func (*PrometheusMetricsImpl) HistogramForResponseTime ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) HistogramForResponseTime(name string, optionalDesc ...string) HistogramFacade
func (*PrometheusMetricsImpl) MustRegister ¶ added in v1.2.3
func (p *PrometheusMetricsImpl) MustRegister(metric prometheus.Collector)
func (*PrometheusMetricsImpl) Register ¶ added in v1.2.2
func (p *PrometheusMetricsImpl) Register(metric prometheus.Collector) error
func (*PrometheusMetricsImpl) Summary ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) Summary(name string, optionalDesc ...string) SummaryFacade
func (*PrometheusMetricsImpl) SummaryWithLabel ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) SummaryWithLabel(name string, labelName string, optionalDesc ...string) LabelledSummaryFacade
func (*PrometheusMetricsImpl) SummaryWithLabels ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) SummaryWithLabels(name string, labelNames []string, optionalDesc ...string) LabelledSummaryFacade
func (*PrometheusMetricsImpl) TestHelper ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) TestHelper() *TestHelper
func (*PrometheusMetricsImpl) Timer ¶ added in v1.1.0
func (p *PrometheusMetricsImpl) Timer(Name string) func() time.Duration
func (*PrometheusMetricsImpl) TimerWithLabel ¶ added in v1.1.0
func (*PrometheusMetricsImpl) TimerWithLabels ¶ added in v1.2.4
type SetGaugeByValue ¶ added in v1.2.0
type SetGaugeByValue interface {
Value(inc float64)
}
type SummaryFacade ¶
type SummaryFacade struct {
// contains filtered or unexported fields
}
func (SummaryFacade) Observe ¶
func (f SummaryFacade) Observe(value float64)
type TestHelper ¶
type TestHelper struct {
// contains filtered or unexported fields
}
func (*TestHelper) Clear ¶
func (h *TestHelper) Clear()
func (*TestHelper) Gather ¶
func (h *TestHelper) Gather() ([]*clientmodel.MetricFamily, error)
func (*TestHelper) GetMetricFamily ¶
func (h *TestHelper) GetMetricFamily(metrics []*clientmodel.MetricFamily, name string) (*clientmodel.MetricFamily, error)
func (*TestHelper) GetMetricLabelValues ¶
func (h *TestHelper) GetMetricLabelValues(name string) LabelsMap
func (*TestHelper) MetricNames ¶
func (h *TestHelper) MetricNames() []string
Click to show internal directories.
Click to hide internal directories.