Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricOption ¶
type MetricOption func(o *prometheus.Opts)
func WithHelpText ¶
func WithHelpText(helpText string) MetricOption
func WithMetricTags ¶
func WithMetricTags(tags map[string]string) MetricOption
type PromRegistry ¶
type PromRegistry struct {
// contains filtered or unexported fields
}
func NewPromRegistry ¶
func NewPromRegistry(defaultSourceID string, logger *log.Logger, opts ...RegistryOption) *PromRegistry
By default, the prom registry will register the metrics route with the default http mux but will not start a http server. This is intentional so that we can combine metrics with other things like pprof into one server. To start a server just for metrics, the WithServer RegistryOption
func (*PromRegistry) NewCounter ¶
func (p *PromRegistry) NewCounter(name string, opts ...MetricOption) Counter
func (*PromRegistry) NewGauge ¶
func (p *PromRegistry) NewGauge(name string, opts ...MetricOption) Gauge
func (*PromRegistry) Port ¶
func (p *PromRegistry) Port() string
type RegistryOption ¶
type RegistryOption func(r *PromRegistry)
func WithDefaultTags ¶
func WithDefaultTags(tags map[string]string) RegistryOption
func WithServer ¶
func WithServer(port int) RegistryOption
Click to show internal directories.
Click to hide internal directories.