Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeCollector ¶
type NodeCollector struct {
// contains filtered or unexported fields
}
NodeCollector is a collector that collects data using prometheus/node_exporter. Since prometheus returns an internal type we have to wrap it with our own type
func NewNodeCollector ¶
func NewNodeCollector() (*NodeCollector, error)
NewNodeCollector creates a new prometheus NodeCollector
func (*NodeCollector) Collect ¶
func (n *NodeCollector) Collect(ch chan<- prometheus.Metric)
Collect collects metrics using prometheus/node_exporter
func (*NodeCollector) Collectors ¶
func (n *NodeCollector) Collectors() map[string]collector.Collector
Collectors returns the list of collectors registered
func (*NodeCollector) Describe ¶
func (n *NodeCollector) Describe(ch chan<- *prometheus.Desc)
Describe describes the metrics collected using prometheus/node_exporter
func (*NodeCollector) Name ¶
func (n *NodeCollector) Name() string
Name returns the name of this collector
type Option ¶
type Option func(o *scraperOpts)
Option is used to configure optional scraper options.
func WithBearerToken ¶
WithBearerToken configures a scraper to use a bearer token
func WithBearerTokenFile ¶
WithBearerTokenFile configures a scraper to use a bearer token read from a file
func WithLogLevel ¶
WithLogLevel configures a custom log level for scraping.
func WithTimeout ¶
WithTimeout configures a scraper with a timeout for scraping metrics.
type Scraper ¶
type Scraper struct {
// contains filtered or unexported fields
}
Scraper is a remote metric scraper that scrapes HTTP endpoints
func NewScraper ¶
func NewScraper(name, metricsEndpoint string, extraMetricLabels []*dto.LabelPair, whitelist map[string]bool, opts ...Option) (*Scraper, error)
NewScraper creates a new scraper to scrape metrics from the provided host
func (*Scraper) Collect ¶
func (s *Scraper) Collect(ch chan<- prometheus.Metric)
Collect collectrs metrics from the remote endpoint and reports them to ch
func (*Scraper) Describe ¶
func (s *Scraper) Describe(ch chan<- *prometheus.Desc)
Describe describes this collector
func (*Scraper) FilterMetric ¶
func (s *Scraper) FilterMetric(metricFamily *dto.MetricFamily) bool
FilterMetric returns true if the metric should be skipped (filtered out)