Versions in this module Expand all Collapse all v0 v0.6.4 Apr 5, 2018 v0.6.3 Apr 5, 2018 Changes in this version + func OpenConnection(ctx context.Context, logContext, dsn string, maxConns, maxIdleConns int) (*sql.DB, error) + func PingDB(ctx context.Context, conn *sql.DB) error + type Collector interface + Collect func(context.Context, *sql.DB, chan<- Metric) + func NewCollector(logContext string, cc *config.CollectorConfig, constLabels []*dto.LabelPair) (Collector, errors.WithContext) + type Exporter interface + Config func() *config.Config + WithContext func(context.Context) Exporter + func NewExporter(configFile string) (Exporter, error) + type Job interface + Targets func() []Target + func NewJob(jc *config.JobConfig, gc *config.GlobalConfig) (Job, errors.WithContext) + type Metric interface + Desc func() MetricDesc + Write func(out *dto.Metric) errors.WithContext + func NewInvalidMetric(err errors.WithContext) Metric + func NewMetric(desc MetricDesc, value float64, labelValues ...string) Metric + type MetricDesc interface + ConstLabels func() []*dto.LabelPair + Help func() string + Labels func() []string + LogContext func() string + Name func() string + ValueType func() prometheus.ValueType + func NewAutomaticMetricDesc(logContext, name, help string, valueType prometheus.ValueType, ...) MetricDesc + type MetricFamily struct + func NewMetricFamily(logContext string, mc *config.MetricConfig, constLabels []*dto.LabelPair) (*MetricFamily, errors.WithContext) + func (mf MetricFamily) Collect(row map[string]interface{}, ch chan<- Metric) + func (mf MetricFamily) ConstLabels() []*dto.LabelPair + func (mf MetricFamily) Help() string + func (mf MetricFamily) Labels() []string + func (mf MetricFamily) LogContext() string + func (mf MetricFamily) Name() string + func (mf MetricFamily) ValueType() prometheus.ValueType + type Query struct + func NewQuery(logContext string, qc *config.QueryConfig, metricFamilies ...*MetricFamily) (*Query, errors.WithContext) + func (q *Query) Collect(ctx context.Context, conn *sql.DB, ch chan<- Metric) + type Target interface + Collect func(ctx context.Context, ch chan<- Metric) + func NewTarget(logContext, name, dsn string, ccs []*config.CollectorConfig, ...) (Target, errors.WithContext)