Documentation ¶
Index ¶
- func ServeMetrics(path, address string) error
- type Builder
- func (b Builder) MustNewConstHistogram(metricDesc *prometheus.Desc, count uint64, sum float64, ...) prometheus.Metric
- func (b Builder) MustNewConstMetric(metricDesc *prometheus.Desc, metricType prometheus.ValueType, value float64, ...) prometheus.Metric
- func (b Builder) MustNewConstSummary(metricDesc *prometheus.Desc, count uint64, sum float64, ...) prometheus.Metric
- func (b Builder) NewMetricCounter(name, description string) (prometheus.Counter, error)
- func (b Builder) NewMetricCounterVec(name, description string, dimensions []string) (*prometheus.CounterVec, error)
- func (b Builder) NewMetricDesc(metricName, metricHelp string, labels []string, staticLabels map[string]string) *prometheus.Desc
- func (b Builder) NewMetricGauge(name, description string) (prometheus.Gauge, error)
- func (b Builder) NewMetricGaugeVec(name, description string, dimensions []string) (*prometheus.GaugeVec, error)
- func (b Builder) NewMetricHistogram(name, description string, buckets []float64, dimensions []string) (prometheus.Histogram, error)
- func (b Builder) NewMetricHistogramVec(name, description string, buckets []float64, dimensions []string) (*prometheus.HistogramVec, error)
- func (b Builder) NewMetricSummary(name, description string, objectives map[float64]float64, dimensions []string) (prometheus.Summary, error)
- func (b Builder) NewMetricSummaryVec(name, description string, objectives map[float64]float64, dimensions []string) (*prometheus.SummaryVec, error)
- type Collector
- type Exporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ServeMetrics ¶
ServeMetrics Creates a new Prometheus exporter, register it and run it
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder structure to sreturn metrics with unique namespace, subsystem and static labels
func NewBuilder ¶
NewBuilder Constructs a new Builder to return new Metrics
func (Builder) MustNewConstHistogram ¶
func (b Builder) MustNewConstHistogram( metricDesc *prometheus.Desc, count uint64, sum float64, buckets map[float64]uint64, labelValues ...string) prometheus.Metric
MustNewConstHistogram Builds a new prometheus metric Counter/Gauge
func (Builder) MustNewConstMetric ¶
func (b Builder) MustNewConstMetric( metricDesc *prometheus.Desc, metricType prometheus.ValueType, value float64, labelValues ...string) prometheus.Metric
MustNewConstMetric Builds a new prometheus Counter/Gauge const Metric, to be used with a custom Collector
func (Builder) MustNewConstSummary ¶
func (b Builder) MustNewConstSummary( metricDesc *prometheus.Desc, count uint64, sum float64, quantiles map[float64]float64, labelValues ...string) prometheus.Metric
MustNewConstSummary Builds a new prometheus metric Counter/Gauge
func (Builder) NewMetricCounter ¶
func (b Builder) NewMetricCounter(name, description string) (prometheus.Counter, error)
NewMetricCounter Builds a new prometheus metric Counter it returns an error if it fails to register the metric in Prometheus
func (Builder) NewMetricCounterVec ¶
func (b Builder) NewMetricCounterVec(name, description string, dimensions []string) (*prometheus.CounterVec, error)
NewMetricCounterVec Builds a new prometheus metric CounterVec it returns an error if it fails to register the metric in Prometheus
func (Builder) NewMetricDesc ¶
func (b Builder) NewMetricDesc( metricName, metricHelp string, labels []string, staticLabels map[string]string) *prometheus.Desc
NewMetricDesc Builds a new prometheus Metric Description
func (Builder) NewMetricGauge ¶
func (b Builder) NewMetricGauge( name, description string) (prometheus.Gauge, error)
NewMetricGauge Builds a new prometheus metric Gauge it returns an error if it fails to register the metric in Prometheus
func (Builder) NewMetricGaugeVec ¶
func (b Builder) NewMetricGaugeVec( name, description string, dimensions []string) (*prometheus.GaugeVec, error)
NewMetricGaugeVec Builds a new prometheus metric GaugeVec it returns an error if it fails to register the metric in Prometheus
func (Builder) NewMetricHistogram ¶
func (b Builder) NewMetricHistogram( name, description string, buckets []float64, dimensions []string) (prometheus.Histogram, error)
NewMetricHistogram Builds a new prometheus metric Histogram it returns an error if it fails to register the metric in Prometheus
func (Builder) NewMetricHistogramVec ¶
func (b Builder) NewMetricHistogramVec( name, description string, buckets []float64, dimensions []string) (*prometheus.HistogramVec, error)
NewMetricHistogramVec Builds a new prometheus metric HistogramVec it returns an error if it fails to register the metric in Prometheus
func (Builder) NewMetricSummary ¶
func (b Builder) NewMetricSummary( name, description string, objectives map[float64]float64, dimensions []string) (prometheus.Summary, error)
NewMetricSummary Builds a new prometheus metric Summary it returns an error if it fails to register the metric in Prometheus
func (Builder) NewMetricSummaryVec ¶
func (b Builder) NewMetricSummaryVec( name, description string, objectives map[float64]float64, dimensions []string) (*prometheus.SummaryVec, error)
NewMetricSummaryVec Builds a new prometheus metric SummaryVec, it returns an error if it fails to register the metric in Prometheus
type Collector ¶
type Collector interface {
Retrieve(ch chan<- prometheus.Metric) error
}
Collector Interface that defines the expected method of a Collector Retrieve method must send prometheus metrics to the ch channel
type Exporter ¶
type Exporter interface { RegisterCollector(collectorName string, collector Collector) error Run() error Collect(ch chan<- prometheus.Metric) Describe(ch chan<- *prometheus.Desc) }
Exporter Interface that defines the expected behavior of the Prometheus exporter, enabling collectors to be registered and the methods to Collect and Describe metrics
func NewExporter ¶
NewExporter Creates a Prometheus exporter