package metric
import "github.com/influxdata/influxdb/kit/metric"
Index ¶
- func ApplyMetricOpts(opts ...ClientOptFn) *metricOpts
- func RecordAdditional(props map[string]interface{}) func(opts *CollectFnOpts)
- type ClientOptFn
- type CollectFnOpts
- type CounterFn
- type HistogramFn
- type REDClient
- func New(reg prometheus.Registerer, service string, opts ...ClientOptFn) *REDClient
- func (c *REDClient) Record(method string) RecordFn
- type RecordFn
- type VecOpts
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.
func (*REDClient) Record ¶
Record returns a record fn that is called on any given return err. If an error is encountered it will register the err metric. The err is never altered.
type RecordFn ¶
type RecordFn func(err error, opts ...func(opts *CollectFnOpts)) error
type VecOpts ¶
type VecOpts struct { Name string Help string LabelNames []string CounterFn CounterFn HistogramFn HistogramFn }
VecOpts expands on the
Source Files ¶
- Version
- v1.12.0 (latest)
- Published
- Apr 8, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 2 days ago –
Tools for package owners.