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 ¶
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.