Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientMetricsRegister ¶
func ClientMetricsRegister(m *ClientMetrics)
func ServerMetricsRegister ¶
func ServerMetricsRegister(m *ServerMetrics)
SerrverMetricsRegister registers all the metrics with Prometheus. It takes care not to register the buckets, if they have not been configured. The counters are registered anyways.
func WrapHandler ¶
Wrap encapsulates a http.Handler which collects prometheus metrics.
Types ¶
type BucketConfig ¶
type BucketConfig []float64
BucketConfig stores the values for buckets. The values must be strict monotonic growing. Use NewBuckconfig to create a configuration from a semicolon separated string.
func NewBucketConfig ¶
func NewBucketConfig(config string) (*BucketConfig, error)
NewBuckConfig returns a new bucketconfiguration from a string representation of the buckets. The string consits of a semicolon separated list of time values, which represent the upper bound of the bucket. Leading and trailing semicolons are forbiddem, as well as double semicolons, which would result in an invalid border. The value of the entroes, when parsed as floats, must e strict monotonic growing.
func NewLargeSizes ¶
func NewLargeSizes() BucketConfig
func NewSlowBuckets ¶
func NewSlowBuckets() BucketConfig
type ClientMetrics ¶
type ClientMetrics struct { ReqCounter *prometheus.CounterVec ReqDurationHisto *prometheus.HistogramVec ReqDurationHistConf BucketConfig ReqDurationPercentiles *prometheus.SummaryVec ReqDurationPercentileConf PercentileConfig }
func NewDefaultClientMetrics ¶
func NewDefaultClientMetrics() *ClientMetrics
type PercentileConfig ¶
PercentileConfig stores percentiles to be reported.
func NewPercentileConfig ¶
func NewPercentileConfig(config string) (*PercentileConfig, error)
NewBuckConfig returns a new bucketconfiguration from a string representation of the buckets. The string consits of a semicolon separated list of time values, which represent the upper bound of the bucket. Leading and trailing semicolons are forbiddem, as well as double semicolons, which would result in an invalid border. The value of the entroes, when parsed as floats, must e strict monotonic growing.
type ServerMetrics ¶
type ServerMetrics struct { ReqInflight prometheus.Gauge ReqCounter *prometheus.CounterVec ReqDurationHisto *prometheus.HistogramVec ReqDurationHistConf BucketConfig ReqDurationPercentiles *prometheus.SummaryVec ReqDurationPercentileConf PercentileConfig ReqSize *prometheus.HistogramVec ReqSizeBuckets BucketConfig RespSize *prometheus.HistogramVec RespSizeBuckets BucketConfig }
Metics holds the prometheus metrics for server side metrics.
func NewDefaultServerMetrics ¶
func NewDefaultServerMetrics() *ServerMetrics