Documentation ¶
Overview ¶
Copyright 2020 The micro-boot Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func SetDefaultCounterConstLabels(labels map[string]string)
- func SetDefaultCounterLabelNames(labels []string)
- func SetDefaultGaugeConstLabels(labels map[string]string)
- func SetDefaultGaugeLabelNames(labels []string)
- func SetDefaultHandlerDisableCompression(n bool)
- func SetDefaultHandlerErrorHandling(n promhttp.HandlerErrorHandling)
- func SetDefaultHandlerMaxRequestsInFlight(n int)
- func SetDefaultHandlerTimeout(d time.Duration)
- func SetDefaultHistogramBuckets(buckets []float64)
- func SetDefaultHistogramConstLabels(labels map[string]string)
- func SetDefaultHistogramLabelNames(labels []string)
- func SetDefaultOptionsConstLabels(labels map[string]string)
- func SetDefaultOptionsLabelNames(labels []string)
- func SetDefaultPrometheusFlagsPrefix(val string)
- func SetDefaultPrometheusPath(val string)
- func SetDefaultSummaryAgeBuckets(num uint32)
- func SetDefaultSummaryBufCap(num uint32)
- func SetDefaultSummaryConstLabels(labels map[string]string)
- func SetDefaultSummaryLabelNames(labels []string)
- func SetDefaultSummaryMaxAge(d time.Duration)
- func SetDefaultSummaryObjectives(objectives map[float64]float64)
- type Config
- type CounterOptions
- type GaugeOptions
- type HandlerOptions
- type HistogramOptions
- type Options
- type SummaryOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetDefaultCounterLabelNames ¶
func SetDefaultCounterLabelNames(labels []string)
func SetDefaultGaugeLabelNames ¶
func SetDefaultGaugeLabelNames(labels []string)
func SetDefaultHandlerDisableCompression ¶
func SetDefaultHandlerDisableCompression(n bool)
func SetDefaultHandlerErrorHandling ¶
func SetDefaultHandlerErrorHandling(n promhttp.HandlerErrorHandling)
func SetDefaultHandlerMaxRequestsInFlight ¶
func SetDefaultHandlerMaxRequestsInFlight(n int)
func SetDefaultHistogramBuckets ¶
func SetDefaultHistogramBuckets(buckets []float64)
func SetDefaultHistogramLabelNames ¶
func SetDefaultHistogramLabelNames(labels []string)
func SetDefaultOptionsLabelNames ¶
func SetDefaultOptionsLabelNames(labels []string)
func SetDefaultPrometheusFlagsPrefix ¶
func SetDefaultPrometheusFlagsPrefix(val string)
func SetDefaultPrometheusPath ¶
func SetDefaultPrometheusPath(val string)
func SetDefaultSummaryAgeBuckets ¶
func SetDefaultSummaryAgeBuckets(num uint32)
func SetDefaultSummaryBufCap ¶
func SetDefaultSummaryBufCap(num uint32)
func SetDefaultSummaryLabelNames ¶
func SetDefaultSummaryLabelNames(labels []string)
func SetDefaultSummaryMaxAge ¶
Types ¶
type Config ¶
type Config struct { Path string `json:"path" yaml:"path"` HandlerOptions HandlerOptions `json:"handler-options" yaml:"handler-options"` CounterOptions map[string]CounterOptions `json:"counter-options" yaml:"counter-options"` GaugeOptions map[string]GaugeOptions `json:"gauge-options" yaml:"gauge-options"` SummaryOptions map[string]SummaryOptions `json:"summary-options" yaml:"summary-options"` HistogramOptions map[string]HistogramOptions `json:"histogram-options" yaml:"histogram-options"` // CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default bind flags behaviour will be used CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
Config to boot prometheus
type CounterOptions ¶
type CounterOptions Options
CounterOptions is a bridge between prometheus.CounterOpts and boot configuration
See the official prometheus Golang client docs https://godoc.org/github.com/prometheus/client_golang/prometheus#CounterOpts for more details
func (*CounterOptions) BindFlags ¶
func (o *CounterOptions) BindFlags(fs *bootflag.FlagSet)
BindFlags binds the fields of CounterOptions with command line flags
func (*CounterOptions) Parse ¶
func (o *CounterOptions) Parse() (err error)
Parse will check if CounterOptions is a valid configuration for prometheus.CounterOpts
func (*CounterOptions) Standardize ¶
func (o *CounterOptions) Standardize() prometheus.CounterOpts
Standardize returns a standard prometheus.CounterOpts
type GaugeOptions ¶
type GaugeOptions Options
GaugeOptions is a bridge between prometheus.CounterOpts and boot configuration
See the official prometheus Golang client docs https://godoc.org/github.com/prometheus/client_golang/prometheus#GaugeOpts for more details
func (*GaugeOptions) BindFlags ¶
func (o *GaugeOptions) BindFlags(fs *bootflag.FlagSet)
BindFlags binds the fields of GaugeOptions with command line flags
func (*GaugeOptions) Parse ¶
func (o *GaugeOptions) Parse() (err error)
Parse will check if GaugeOptions is a valid configuration for prometheus.GaugeOpts
func (*GaugeOptions) Standardize ¶
func (o *GaugeOptions) Standardize() prometheus.GaugeOpts
Standardize returns a standard prometheus.GaugeOpts
type HandlerOptions ¶
type HandlerOptions struct { DisableCompression bool `json:"compression" yaml:"compression"` MaxRequestsInFlight int `json:"max-requests-in-flight" yaml:"max-requests-in-flight"` Timeout time.Duration `json:"timeout" yaml:"timeout"` ErrorHandling promhttp.HandlerErrorHandling `json:"error-handling" yaml:"error-handling"` // CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default bind flags behaviour will be used CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
HandlerOptions is a bridge between promhttp.HandlerOpts and boot configuration
See the official prometheus Golang client docs https://godoc.org/github.com/prometheus/client_golang/prometheus/promhttp#HandlerOpts for more details
func (*HandlerOptions) BindFlags ¶
func (o *HandlerOptions) BindFlags(fs *bootflag.FlagSet)
BindFlags binds the fields of HandlerOptions with command line flags
func (*HandlerOptions) Parse ¶
func (o *HandlerOptions) Parse() (err error)
func (HandlerOptions) Standardize ¶
func (o HandlerOptions) Standardize() (opts promhttp.HandlerOpts)
Standardize returns a standard promhttp.HandlerOpts.
type HistogramOptions ¶
type HistogramOptions struct { Namespace string `json:"namespace" yaml:"namespace"` Subsystem string `json:"subsystem" yaml:"subsystem"` Name string `json:"name" yaml:"name"` Help string `json:"help" yaml:"help"` ConstLabels map[string]string `json:"labels" yaml:"labels"` LabelNames []string `json:"label-names" yaml:"label-names"` Buckets []float64 `json:"buckets" yaml:"buckets"` CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
HistogramOptions is a bridge between prometheus.HistogramOpts and boot configuration
See the official prometheus Golang client docs https://godoc.org/github.com/prometheus/client_golang/prometheus#HistogramOpts for more details
func (*HistogramOptions) BindFlags ¶
func (o *HistogramOptions) BindFlags(fs *bootflag.FlagSet)
BindFlags binds the fields of HistogramOptions with command line flags
func (*HistogramOptions) Parse ¶
func (o *HistogramOptions) Parse() (err error)
Parse will check if HistogramOptions is a valid configuration for prometheus.HistogramOpts
func (*HistogramOptions) Standardize ¶
func (o *HistogramOptions) Standardize() prometheus.HistogramOpts
Standardize returns a standard prometheus.HistogramOpts
type Options ¶
type Options struct { Namespace string `json:"namespace" yaml:"namespace"` Subsystem string `json:"subsystem" yaml:"subsystem"` Name string `json:"name" yaml:"name"` Help string `json:"help" yaml:"help"` ConstLabels map[string]string `json:"labels" yaml:"labels"` LabelNames []string `json:"label-names" yaml:"label-names"` CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
Options is a bridge between prometheus.Opts and boot configuration
See the official prometheus Golang client docs https://godoc.org/github.com/prometheus/client_golang/prometheus#Opts for more details
func (*Options) Standardize ¶
func (o *Options) Standardize() prometheus.Opts
Standardize returns a standard prometheus.Opts
type SummaryOptions ¶
type SummaryOptions struct { Namespace string `json:"namespace" yaml:"namespace"` Subsystem string `json:"subsystem" yaml:"subsystem"` Name string `json:"name" yaml:"name"` Help string `json:"help" yaml:"help"` ConstLabels map[string]string `json:"labels" yaml:"labels"` LabelNames []string `json:"label-names" yaml:"label-names"` Objectives map[float64]float64 `json:"objectives" yaml:"objectives"` MaxAge time.Duration `json:"max-age" yaml:"max-age"` AgeBuckets uint32 `json:"age-buckets" yaml:"age-buckets"` BufCap uint32 `json:"buf-cap" yaml:"buf-cap"` CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
SummaryOptions is a bridge between prometheus.SummaryOpts and boot configuration
See the official prometheus Golang client docs https://godoc.org/github.com/prometheus/client_golang/prometheus#SummaryOpts for more details
func (*SummaryOptions) BindFlags ¶
func (o *SummaryOptions) BindFlags(fs *bootflag.FlagSet)
BindFlags binds the fields of SummaryOptions with command line flags
func (*SummaryOptions) Parse ¶
func (o *SummaryOptions) Parse() (err error)
Parse will check if SummaryOptions is a valid configuration for prometheus.SummaryOpts
func (*SummaryOptions) Standardize ¶
func (o *SummaryOptions) Standardize() prometheus.SummaryOpts
Standardize returns a standard prometheus.SummaryOpts