package prometheus
import "github.com/uber/jaeger-lib/metrics/prometheus"
Index ¶
- type Factory
- func New(opts ...Option) *Factory
- func (f *Factory) Counter(options metrics.Options) metrics.Counter
- func (f *Factory) Gauge(options metrics.Options) metrics.Gauge
- func (f *Factory) Histogram(options metrics.HistogramOptions) metrics.Histogram
- func (f *Factory) Namespace(scope metrics.NSOptions) metrics.Factory
- func (f *Factory) Timer(options metrics.TimerOptions) metrics.Timer
- type Option
- func WithBuckets(buckets []float64) Option
- func WithRegisterer(registerer prometheus.Registerer) Option
- func WithSeparator(separator Separator) Option
- type Separator
Types ¶
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory implements metrics.Factory backed by Prometheus registry.
func New ¶
New creates a Factory backed by Prometheus registry. Typically the first argument should be prometheus.DefaultRegisterer.
Parameter buckets defines the buckets into which Timer observations are counted. Each element in the slice is the upper inclusive bound of a bucket. The values must be sorted in strictly increasing order. There is no need to add a highest bucket with +Inf bound, it will be added implicitly. The default value is prometheus.DefBuckets.
func (*Factory) Counter ¶
Counter implements Counter of metrics.Factory.
func (*Factory) Gauge ¶
Gauge implements Gauge of metrics.Factory.
func (*Factory) Histogram ¶
func (f *Factory) Histogram(options metrics.HistogramOptions) metrics.Histogram
Histogram implements Histogram of metrics.Factory.
func (*Factory) Namespace ¶
Namespace implements Namespace of metrics.Factory.
func (*Factory) Timer ¶
func (f *Factory) Timer(options metrics.TimerOptions) metrics.Timer
Timer implements Timer of metrics.Factory.
type Option ¶
type Option func(*options)
Option is a function that sets some option for the Factory constructor.
func WithBuckets ¶
WithBuckets returns an option that sets the default buckets for histogram. If not used, we fallback to default Prometheus buckets.
func WithRegisterer ¶
func WithRegisterer(registerer prometheus.Registerer) Option
WithRegisterer returns an option that sets the registerer. If not used we fallback to prometheus.DefaultRegisterer.
func WithSeparator ¶
WithSeparator returns an option that sets the default separator for the namespace If not used, we fallback to underscore.
type Separator ¶
type Separator rune
Separator represents the namespace separator to use
const ( // SeparatorUnderscore uses an underscore as separator SeparatorUnderscore Separator = '_' // SeparatorColon uses a colon as separator SeparatorColon = ':' )
Source Files ¶
- Version
- v2.4.1+incompatible (latest)
- Published
- Mar 29, 2021
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 6 hours ago –
Tools for package owners.