Skip to content

hystrixprometheus provides a Prometheus metrics collector for Hystrix (https://github.com/afex/hystrix-go). This is a workaround for hystrix-go not supporting the prometheus registry

License

Notifications You must be signed in to change notification settings

go-coldbrew/hystrixprometheus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

hystrixprometheus

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)

Index

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

About

hystrixprometheus provides a Prometheus metrics collector for Hystrix (https://github.com/afex/hystrix-go). This is a workaround for hystrix-go not supporting the prometheus registry

Topics

Resources

License

Stars

Watchers

Forks