collector

package
v0.0.0-...-f984ff3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DSN                string
	MaxIdleConns       int
	MaxOpenConns       int
	CustomMetrics      string
	QueryTimeout       int
	DefaultMetricsFile string
}

Config is the configuration of the exporter

func CreateDefaultConfig

func CreateDefaultConfig() *Config

CreateDefaultConfig returns the default configuration of the Exporter it is to be of note that the DNS will be empty when

type Exporter

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

Exporter collects Oracle DB metrics. It implements prometheus.Collector.

func NewExporter

func NewExporter(logger log.Logger, cfg *Config) (*Exporter, error)

NewExporter creates a new Exporter instance

func (*Exporter) Collect

func (e *Exporter) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector.

func (*Exporter) DefaultMetrics

func (e *Exporter) DefaultMetrics() Metrics

DefaultMetrics is a somewhat hacky way to load the default metrics

func (*Exporter) Describe

func (e *Exporter) Describe(ch chan<- *prometheus.Desc)

Describe describes all the metrics exported by the Oracle DB exporter.

func (*Exporter) RunScheduledScrapes

func (e *Exporter) RunScheduledScrapes(ctx context.Context, si time.Duration)

RunScheduledScrapes is only relevant for users of this package that want to set the scrape on a timer rather than letting it be per Collect call

func (*Exporter) ScrapeMetric

func (e *Exporter) ScrapeMetric(db *sql.DB, ch chan<- prometheus.Metric, metricDefinition Metric) error

ScrapeMetric is an interface method to call scrapeGenericValues using Metric struct values

type Metric

type Metric struct {
	Context          string
	Labels           []string
	MetricsDesc      map[string]string
	MetricsType      map[string]string
	MetricsBuckets   map[string]map[string]string
	FieldToAppend    string
	Request          string
	IgnoreZeroResult bool
}

Metric is an object description

type Metrics

type Metrics struct {
	Metric []Metric `json:"metrics"`
}

Metrics is a container structure for prometheus metrics

Jump to

Keyboard shortcuts

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