Documentation
¶
Overview ¶
Package scraperhelper provides utilities for scrapers.
Index ¶
- func NewLogsController(cfg *ControllerConfig, rSet receiver.Settings, nextConsumer consumer.Logs, ...) (receiver.Logs, error)
- func NewMetricsController(cfg *ControllerConfig, rSet receiver.Settings, nextConsumer consumer.Metrics, ...) (receiver.Metrics, error)
- type ControllerConfig
- type ControllerOption
- func AddFactoryWithConfig(f scraper.Factory, cfg component.Config) ControllerOption
- func AddMetricsScraper(t component.Type, sc scraper.Metrics) ControllerOption
- func AddScraper(t component.Type, sc scraper.Metrics) ControllerOptiondeprecated
- func WithTickerChannel(tickerCh <-chan time.Time) ControllerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogsController ¶ added in v0.119.0
func NewLogsController(cfg *ControllerConfig, rSet receiver.Settings, nextConsumer consumer.Logs, options ...ControllerOption, ) (receiver.Logs, error)
NewLogsController creates a receiver.Logs with the configured options, that can control multiple scraper.Logs.
func NewMetricsController ¶ added in v0.118.0
func NewMetricsController(cfg *ControllerConfig, rSet receiver.Settings, nextConsumer consumer.Metrics, options ...ControllerOption, ) (receiver.Metrics, error)
NewMetricsController creates a receiver.Metrics with the configured options, that can control multiple scraper.Metrics.
Types ¶
type ControllerConfig ¶
type ControllerConfig = controller.ControllerConfig
func NewDefaultControllerConfig ¶
func NewDefaultControllerConfig() ControllerConfig
NewDefaultControllerConfig returns default scraper controller settings with a collection interval of one minute.
type ControllerOption ¶ added in v0.118.0
type ControllerOption interface {
// contains filtered or unexported methods
}
ControllerOption apply changes to internal options.
func AddFactoryWithConfig ¶ added in v0.118.0
func AddFactoryWithConfig(f scraper.Factory, cfg component.Config) ControllerOption
AddFactoryWithConfig configures the scraper.Factory and associated config that will be used to create a new scraper. The created scraper will be called with the specified options, and at the specified collection interval.
Observability information will be reported, and the scraped metrics will be passed to the next consumer.
func AddMetricsScraper ¶ added in v0.144.0
func AddMetricsScraper(t component.Type, sc scraper.Metrics) ControllerOption
AddMetricsScraper configures the scraper.Metrics to be called with the specified options, and at the specified collection interval.
Observability information will be reported, and the scraped metrics will be passed to the next consumer.
func AddScraper
deprecated
func AddScraper(t component.Type, sc scraper.Metrics) ControllerOption
AddScraper configures the scraper.Metrics to be called with the specified options, and at the specified collection interval.
Observability information will be reported, and the scraped metrics will be passed to the next consumer.
Deprecated: [0.144.0] Use AddMetricsScraper instead.
func WithTickerChannel ¶
func WithTickerChannel(tickerCh <-chan time.Time) ControllerOption
WithTickerChannel allows you to override the scraper controller's ticker channel to specify when scrape is called. This is only expected to be used by tests.