import "github.com/go-coldbrew/hystrixprometheus"
Package hystrixprometheus provides a Prometheus metrics collector for Hystrix (https://github.com/afex/hystrix-go\) that can be used to export metrics to Prometheus. The collector is built on top of hystrix-go/hystrix/metric_collector interface.
Usage
promC := hystrixprometheus.NewPrometheusCollector("hystrix", nil, prometheus.DefBuckets)
metricCollector.Registry.Register(promC.Collector)
type PrometheusCollector
PrometheusCollector implements the metricCollector interface and exposes metrics for Prometheus.
type PrometheusCollector struct {
// contains filtered or unexported fields
}
func NewPrometheusCollector(namespace string, reg prometheus.Registerer, durationBuckets []float64) *PrometheusCollector
NewPrometheusCollector creates a new PrometheusCollector. The namespace is used as the prefix for all metrics. If the namespace is empty, the prefix will be "hystrix". The durationBuckets are used for the totalDuration and runDuration metrics. If the durationBuckets are nil, the default buckets will be used.
func (*PrometheusCollector) Collector
func (pc *PrometheusCollector) Collector(name string) metricCollector.MetricCollector
Collector returns a metricCollector.MetricCollector for the given command name. The returned collector is used to collect metrics for the command.
Generated by gomarkdoc