harness

package
v0.0.0-...-b6a609d Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMetricsPath = "/metrics"
View Source
const Version = "0.0.1"

Variables

This section is empty.

Functions

func Main

func Main(opts *ExporterOpts)

func MakeApp

func MakeApp(opts *ExporterOpts) *cli.App

func MakeMetricName

func MakeMetricName(parts ...string) string

Types

type Collector

type Collector interface {
	Collect(*MetricRegistry)
}

type ExporterOpts

type ExporterOpts struct {
	// The representative name of exporter
	Name string
	// The version of exporter
	Version string
	// The HTTP endpoint path which used to provide metrics
	MetricsPath string
	// Whether to call Collect() of collector periodically
	Tick bool
	// Whether to reset all metrics per tick
	ResetOnTick bool
	// Command line usage
	Usage string
	// Additional command line flags which can be accepted
	Flags []cli.Flag
	// Function to instantiate collector
	Init func(*cli.Context, *MetricRegistry) (Collector, error)
}

func NewExporterOpts

func NewExporterOpts(name string, version string) *ExporterOpts

type MetricRegistry

type MetricRegistry struct {
	// contains filtered or unexported fields
}

func (*MetricRegistry) Get

func (reg *MetricRegistry) Get(name string) prometheus.Collector

func (*MetricRegistry) Register

func (reg *MetricRegistry) Register(name string, metric prometheus.Collector)

func (*MetricRegistry) Reset

func (reg *MetricRegistry) Reset()

func (*MetricRegistry) Unregister

func (reg *MetricRegistry) Unregister(name string)

Jump to

Keyboard shortcuts

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