Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportMetrics ¶
func ExportMetrics(ctx context.Context, metricsRegistry MetricsRegistry, opt Options) error
ExportMetrics exports metrics from go-metrics to prometheus.
Types ¶
type MetricsRegistry ¶
type MetricsRegistry interface {
Each(func(name string, i interface{}))
}
MetricsRegistry is an interface for 'github.com/rcrowley/go-metrics'.Registry which is used for metrics in sarama.
type Options ¶
type Options struct { // PrometheusRegistry is prometheus registry. Default prometheus.DefaultRegisterer. PrometheusRegistry prometheus.Registerer // Namespace and Subsystem form the metric name prefix. // Default Subsystem is "sarama". Namespace string Subsystem string // Label specifies value of "label" label. It is recomended // to always set the label to avoid collisions between sarama // instances. Default "". Label string // FlushInterval specifies interval between updating metrics. Default 1s. FlushInterval time.Duration // OnError is error handler. Default handler panics when error occurred. OnError func(err error) // Debug turns on debug logging. Debug bool }
Options holds optional params for ExportMetrics.
Click to show internal directories.
Click to hide internal directories.