metric

package
v2.0.0-beta.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMetricOpts

func ApplyMetricOpts(opts ...MetricsOption) *metricOpts

Types

type MetricsOption

type MetricsOption func(*metricOpts)

MetricsOption is an option used by a metric middleware.

func WithSuffix

func WithSuffix(suffix string) MetricsOption

WithSuffix returns a metric option that applies a suffix to the service name of the metric.

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) *REDClient

New creates a new REDClient.

func (*REDClient) Record

func (c *REDClient) Record(method string) func(error) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL