Documentation ¶
Index ¶
- Variables
- func StringSliceToPrometheusLabels(keysAndValues []string) prometheus.Labels
- type Counter
- type Gauge
- type Histogram
- type MetricOption
- func InterfaceSliceToMetricOptionSlice(interfaceOptions []interface{}) []MetricOption
- func WithBuckets(buckets []float64) MetricOption
- func WithHelp(help string) MetricOption
- func WithLabels(labels []string) MetricOption
- func WithName(name string) MetricOption
- func WithNamespace(namespace string) MetricOption
- func WithRegistry(registry *prometheus.Registry) MetricOption
- func WithSubsystem(subsystem string) MetricOption
- type MetricOptionSet
- type MetricService
- type MetricServiceOption
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultHttpHandlerOptions = promhttp.HandlerOpts{ Timeout: 10 * time.Second, DisableCompression: true, MaxRequestsInFlight: 10, EnableOpenMetrics: true, } )
Functions ¶
func StringSliceToPrometheusLabels ¶
func StringSliceToPrometheusLabels(keysAndValues []string) prometheus.Labels
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
func NewCounter ¶
func NewCounter(options ...MetricOption) *Counter
func (*Counter) WithLabelValues ¶
type Gauge ¶
type Gauge struct {
// contains filtered or unexported fields
}
func NewGauge ¶
func NewGauge(options ...MetricOption) *Gauge
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
func NewHistogram ¶
func NewHistogram(options ...MetricOption) *Histogram
func (*Histogram) WithLabelValues ¶
type MetricOption ¶
type MetricOption func(*MetricOptionSet)
func InterfaceSliceToMetricOptionSlice ¶
func InterfaceSliceToMetricOptionSlice(interfaceOptions []interface{}) []MetricOption
func WithBuckets ¶
func WithBuckets(buckets []float64) MetricOption
func WithHelp ¶
func WithHelp(help string) MetricOption
func WithLabels ¶
func WithLabels(labels []string) MetricOption
func WithName ¶
func WithName(name string) MetricOption
func WithNamespace ¶
func WithNamespace(namespace string) MetricOption
func WithRegistry ¶
func WithRegistry(registry *prometheus.Registry) MetricOption
func WithSubsystem ¶
func WithSubsystem(subsystem string) MetricOption
type MetricOptionSet ¶
type MetricOptionSet struct { prometheus.Opts Buckets []float64 Labels []string // contains filtered or unexported fields }
func NewMetricOptionSet ¶
func NewMetricOptionSet(options ...MetricOption) *MetricOptionSet
func (*MetricOptionSet) AsCounterOpts ¶
func (o *MetricOptionSet) AsCounterOpts() prometheus.CounterOpts
func (*MetricOptionSet) AsGaugeOpts ¶
func (o *MetricOptionSet) AsGaugeOpts() prometheus.GaugeOpts
func (*MetricOptionSet) AsHistogramOpts ¶
func (o *MetricOptionSet) AsHistogramOpts() prometheus.HistogramOpts
type MetricService ¶
type MetricService struct {
// contains filtered or unexported fields
}
func NewMetricService ¶
func NewMetricService(options ...MetricServiceOption) *MetricService
func (*MetricService) Counter ¶
func (m *MetricService) Counter(options ...interface{}) metrics.Counter
func (*MetricService) Gauge ¶
func (m *MetricService) Gauge(options ...interface{}) metrics.Gauge
func (*MetricService) Handler ¶
func (m *MetricService) Handler() http.Handler
func (*MetricService) Histogram ¶
func (m *MetricService) Histogram(options ...interface{}) metrics.Histogram
func (*MetricService) Push ¶
func (m *MetricService) Push() error
type MetricServiceOption ¶
type MetricServiceOption func(*MetricService)
func WithHttpHandlerOptions ¶
func WithHttpHandlerOptions(httpHandlerOptions promhttp.HandlerOpts) MetricServiceOption
func WithPusher ¶
func WithPusher(url, job string) MetricServiceOption
func WithPusherGrouping ¶
func WithPusherGrouping(key, value string) MetricServiceOption
Click to show internal directories.
Click to hide internal directories.