Documentation ¶
Index ¶
- func CombineScrapeErrors(errs []error) error
- func NewFactory(cfgType configmodels.Type, createDefaultConfig CreateDefaultConfig, ...) component.ReceiverFactory
- func NewScraperControllerReceiver(cfg *ScraperControllerSettings, nextConsumer consumer.MetricsConsumer, ...) (component.Receiver, error)
- type BaseScraper
- type Close
- type CreateDefaultConfig
- type CreateLogsReceiver
- type CreateMetricsReceiver
- type CreateTraceReceiver
- type FactoryOption
- func WithCustomUnmarshaler(customUnmarshaler component.CustomUnmarshaler) FactoryOption
- func WithLogs(createLogsReceiver CreateLogsReceiver) FactoryOption
- func WithMetrics(createMetricsReceiver CreateMetricsReceiver) FactoryOption
- func WithTraces(createTraceReceiver CreateTraceReceiver) FactoryOption
- type Initialize
- type MetricsScraper
- type ResourceMetricsScraper
- type ScrapeMetrics
- type ScrapeResourceMetrics
- type ScraperControllerOption
- type ScraperControllerSettings
- type ScraperOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineScrapeErrors ¶ added in v0.14.0
CombineScrapeErrors converts a list of errors into one error.
func NewFactory ¶
func NewFactory( cfgType configmodels.Type, createDefaultConfig CreateDefaultConfig, options ...FactoryOption) component.ReceiverFactory
NewFactory returns a component.ReceiverFactory.
func NewScraperControllerReceiver ¶ added in v0.13.0
func NewScraperControllerReceiver(cfg *ScraperControllerSettings, nextConsumer consumer.MetricsConsumer, options ...ScraperControllerOption) (component.Receiver, error)
NewScraperControllerReceiver creates a Receiver with the configured options, that can control multiple scrapers.
Types ¶
type BaseScraper ¶ added in v0.13.0
type BaseScraper interface { // Name returns the scraper name Name() string // Initialize performs any timely initialization tasks such as // setting up performance counters for initial collection. Initialize(ctx context.Context) error // Close should clean up any unmanaged resources such as // performance counter handles. Close(ctx context.Context) error }
type Close ¶ added in v0.13.0
Close should clean up any unmanaged resources such as performance counter handles.
type CreateDefaultConfig ¶
type CreateDefaultConfig func() configmodels.Receiver
CreateDefaultConfig is the equivalent of component.ReceiverFactory.CreateDefaultConfig()
type CreateLogsReceiver ¶ added in v0.7.0
type CreateLogsReceiver func(context.Context, component.ReceiverCreateParams, configmodels.Receiver, consumer.LogsConsumer) (component.LogsReceiver, error)
CreateLogsReceiver is the equivalent of component.ReceiverFactory.CreateLogsReceiver()
type CreateMetricsReceiver ¶
type CreateMetricsReceiver func(context.Context, component.ReceiverCreateParams, configmodels.Receiver, consumer.MetricsConsumer) (component.MetricsReceiver, error)
CreateMetricsReceiver is the equivalent of component.ReceiverFactory.CreateMetricsReceiver()
type CreateTraceReceiver ¶
type CreateTraceReceiver func(context.Context, component.ReceiverCreateParams, configmodels.Receiver, consumer.TracesConsumer) (component.TracesReceiver, error)
CreateTraceReceiver is the equivalent of component.ReceiverFactory.CreateTracesReceiver()
type FactoryOption ¶
type FactoryOption func(o *factory)
FactoryOption apply changes to ReceiverOptions.
func WithCustomUnmarshaler ¶
func WithCustomUnmarshaler(customUnmarshaler component.CustomUnmarshaler) FactoryOption
WithCustomUnmarshaler implements component.ConfigUnmarshaler.
func WithLogs ¶ added in v0.7.0
func WithLogs(createLogsReceiver CreateLogsReceiver) FactoryOption
WithLogs overrides the default "error not supported" implementation for CreateLogsReceiver.
func WithMetrics ¶
func WithMetrics(createMetricsReceiver CreateMetricsReceiver) FactoryOption
WithMetrics overrides the default "error not supported" implementation for CreateMetricsReceiver.
func WithTraces ¶
func WithTraces(createTraceReceiver CreateTraceReceiver) FactoryOption
WithTraces overrides the default "error not supported" implementation for CreateTraceReceiver.
type Initialize ¶ added in v0.13.0
Initialize performs any timely initialization tasks such as setting up performance counters for initial collection.
type MetricsScraper ¶ added in v0.13.0
type MetricsScraper interface { BaseScraper Scrape(context.Context, string) (pdata.MetricSlice, error) }
MetricsScraper is an interface for scrapers that scrape metrics.
func NewMetricsScraper ¶ added in v0.13.0
func NewMetricsScraper( name string, scrape ScrapeMetrics, options ...ScraperOption, ) MetricsScraper
NewMetricsScraper creates a Scraper that calls Scrape at the specified collection interval, reports observability information, and passes the scraped metrics to the next consumer.
type ResourceMetricsScraper ¶ added in v0.13.0
type ResourceMetricsScraper interface { BaseScraper Scrape(context.Context, string) (pdata.ResourceMetricsSlice, error) }
ResourceMetricsScraper is an interface for scrapers that scrape resource metrics.
func NewResourceMetricsScraper ¶ added in v0.13.0
func NewResourceMetricsScraper( name string, scrape ScrapeResourceMetrics, options ...ScraperOption, ) ResourceMetricsScraper
NewResourceMetricsScraper creates a Scraper that calls Scrape at the specified collection interval, reports observability information, and passes the scraped resource metrics to the next consumer.
type ScrapeMetrics ¶ added in v0.13.0
type ScrapeMetrics func(context.Context) (pdata.MetricSlice, error)
Scrape metrics.
type ScrapeResourceMetrics ¶ added in v0.13.0
type ScrapeResourceMetrics func(context.Context) (pdata.ResourceMetricsSlice, error)
Scrape resource metrics.
type ScraperControllerOption ¶ added in v0.13.0
type ScraperControllerOption func(*scraperController)
ScraperControllerOption apply changes to internal options.
func AddMetricsScraper ¶ added in v0.13.0
func AddMetricsScraper(scraper MetricsScraper) ScraperControllerOption
AddMetricsScraper configures the provided scrape function 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 AddResourceMetricsScraper ¶ added in v0.13.0
func AddResourceMetricsScraper(scraper ResourceMetricsScraper) ScraperControllerOption
AddResourceMetricsScraper configures the provided scrape function to be called with the specified options, and at the specified collection interval.
Observability information will be reported, and the scraped resource metrics will be passed to the next consumer.
func WithTickerChannel ¶ added in v0.13.0
func WithTickerChannel(tickerCh <-chan time.Time) ScraperControllerOption
WithTickerChannel allows you to override the scraper controllers ticker channel to specify when scrape is called. This is only expected to be used by tests.
type ScraperControllerSettings ¶ added in v0.13.0
type ScraperControllerSettings struct { configmodels.ReceiverSettings `mapstructure:"squash"` CollectionInterval time.Duration `mapstructure:"collection_interval"` }
ScraperControllerSettings defines common settings for a scraper controller configuration. Scraper controller receivers can embed this struct, instead of configmodels.ReceiverSettings, and extend it with more fields if needed.
func DefaultScraperControllerSettings ¶ added in v0.13.0
func DefaultScraperControllerSettings(cfgType configmodels.Type) ScraperControllerSettings
DefaultScraperControllerSettings returns default scraper controller settings with a collection interval of one minute.
type ScraperOption ¶ added in v0.13.0
type ScraperOption func(*baseScraper)
ScraperOption apply changes to internal options.
func WithClose ¶ added in v0.13.0
func WithClose(close Close) ScraperOption
WithClose sets the function that will be called on shutdown.
func WithInitialize ¶ added in v0.13.0
func WithInitialize(initialize Initialize) ScraperOption
WithInitialize sets the function that will be called on startup.