Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMetricOpts ¶
func ApplyMetricOpts(opts ...ClientOptFn) *metricOpts
func RecordAdditional ¶
func RecordAdditional(props map[string]interface{}) func(opts *CollectFnOpts)
RecordAdditional provides an extension to the base method, err data provided to the metrics.
Types ¶
type ClientOptFn ¶
type ClientOptFn func(*metricOpts)
ClientOptFn is an option used by a metric middleware.
func WithSuffix ¶
func WithSuffix(suffix string) ClientOptFn
WithSuffix returns a metric option that applies a suffix to the service name of the metric.
func WithVec ¶
func WithVec(opts VecOpts) ClientOptFn
WithVec sets a new counter vector to be collected.
type CollectFnOpts ¶
type CollectFnOpts struct { Method string Start time.Time Err error AdditionalProps map[string]interface{} }
CollectFnOpts provides arguments to the collect operation of a metric.
type CounterFn ¶
type CounterFn func(vec *prometheus.CounterVec, o CollectFnOpts)
type HistogramFn ¶
type HistogramFn func(vec *prometheus.HistogramVec, o CollectFnOpts)
type REDClient ¶
type REDClient struct {
// contains filtered or unexported fields
}
REDClient is a metrics client for collection RED metrics.
func New ¶
func New(reg prometheus.Registerer, service string, opts ...ClientOptFn) *REDClient
New creates a new REDClient.
type RecordFn ¶
type RecordFn func(err error, opts ...func(opts *CollectFnOpts)) error
Click to show internal directories.
Click to hide internal directories.