Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // LatencyBuckets is the collection of buckets to use for latency/request duration histograms. // If you wish to change this, this should be changed _before_ creating any objects which provide latency histograms, // as this variable is used at collector creation time. LatencyBuckets = []float64{.005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10, 25, 50, 100} )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Namespace for the collectors Namespace string // NativeHistogramBucketFactor is used for native histograms, see // https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#HistogramOpts NativeHistogramBucketFactor float64 // NativeHistogramMaxBucketNumber is used to define the max number of buckets // in a native histogram, see https://pkg.go.dev/github.com/prometheus/client_golang/prometheus#HistogramOpts NativeHistogramMaxBucketNumber uint32 }
Config is the general set of configuration options for creating prometheus Collectors
func DefaultConfig ¶
DefaultConfig returns a Config with the provided namespace and all other values set to defaults.
type Exporter ¶
type Exporter struct { Registerer prometheus.Registerer Gatherer prometheus.Gatherer Port int }
Exporter exports prometheus metrics
func NewExporter ¶
func NewExporter(cfg ExporterConfig) *Exporter
NewExporter returns a new Exporter using the provided config. Empty values in the config apply default prometheus values.
func (*Exporter) RegisterCollectors ¶
func (e *Exporter) RegisterCollectors(metrics ...prometheus.Collector) error
RegisterCollectors registers the provided collectors with the Exporter's Registerer. If there is an error registering any of the provided collectors, registration is halted and an error is returned.
type ExporterConfig ¶
type ExporterConfig struct { Registerer prometheus.Registerer Gatherer prometheus.Gatherer Port int }
ExporterConfig is the configuration used for the Exporter
type Provider ¶
type Provider interface {
PrometheusCollectors() []prometheus.Collector
}
Provider is an interface which describes any object which can provide the prometheus Collectors is uses for registration