v1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MongoDB  MongoDB
	Bind     string
	LogLevel string
	Metrics  []*Metric
}

Configuration v1.0 format

func (*Config) Build

func (conf *Config) Build() (*collector.Collector, error)

Build a collector from a configuration v1.0 format and return an Exprter with that collector. Note the v1.0 config does not support multiple collectors, you may instead use the v2.0 format.

func (*Config) GetBindAddr

func (conf *Config) GetBindAddr() string

Get address where the http server should be bound to

func (*Config) GetMetricsPath

func (conf *Config) GetMetricsPath() string

Get metrics path

type Metric

type Metric struct {
	Cache         int64
	Mode          string
	Database      string
	Collection    string
	Pipeline      string
	Name          string
	Type          string
	Help          string
	Value         string
	OverrideEmpty bool
	EmptyValue    int64
	ConstLabels   prometheus.Labels
	Labels        []string
}

Metric defines an exported metric from a MongoDB aggregation pipeline

type MongoDB

type MongoDB struct {
	URI               string
	MaxConnections    int32
	ConnectionTimeout time.Duration
	DefaultInterval   int64
	DefaultDatabase   string
	DefaultCollection string
}

MongoDB client options

Jump to

Keyboard shortcuts

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