scraper

package
v0.0.0-...-7cdc85d Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigProvider

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

func NewConfigProvider

func NewConfigProvider(globs []string, defaultScrapeInterval time.Duration, log *log.Logger) *ConfigProvider

func (*ConfigProvider) Configs

func (p *ConfigProvider) Configs() ([]PromScraperConfig, error)

type MetricsEmitter

type MetricsEmitter interface {
	EmitGauge(opts ...loggregator.EmitGaugeOption)
	EmitCounter(name string, opts ...loggregator.EmitCounterOption)
}

type MetricsGetter

type MetricsGetter func(addr string, headers map[string]string) (*http.Response, error)

type PromScraperConfig

type PromScraperConfig struct {
	Port           string            `yaml:"port"`
	SourceID       string            `yaml:"source_id"`
	InstanceID     string            `yaml:"instance_id"`
	Scheme         string            `yaml:"scheme"`
	ServerName     string            `yaml:"server_name"`
	Path           string            `yaml:"path"`
	Headers        map[string]string `yaml:"headers"`
	Labels         map[string]string `yaml:"labels"`
	CaPath         string            `yaml:"ca_path"`
	ClientKeyPath  string            `yaml:"client_key_path"`
	ClientCertPath string            `yaml:"client_cert_path"`
	ScrapeInterval time.Duration     `yaml:"scrape_interval"`
}

type ScrapeError

type ScrapeError struct {
	ID         string
	InstanceID string
	MetricURL  string
	Err        error
}

func (*ScrapeError) Error

func (e *ScrapeError) Error() string

type ScrapeOption

type ScrapeOption func(s *Scraper)

func WithMetricsClient

func WithMetricsClient(m metricsClient) ScrapeOption

type Scraper

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

func New

func New(
	t TargetProvider,
	e MetricsEmitter,
	sc MetricsGetter,
	defaultID string,
	opts ...ScrapeOption,
) *Scraper

func (*Scraper) Scrape

func (s *Scraper) Scrape() error

type ScraperError

type ScraperError struct {
	Errors []*ScrapeError
}

func (*ScraperError) Error

func (e *ScraperError) Error() string

type Target

type Target struct {
	ID          string
	InstanceID  string
	MetricURL   string
	Headers     map[string]string
	DefaultTags map[string]string
}

type TargetProvider

type TargetProvider func() []Target

func NewDNSScrapeTargetProvider

func NewDNSScrapeTargetProvider(sourceID, dnsFile string, port int) TargetProvider

Jump to

Keyboard shortcuts

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