Documentation
¶
Overview ¶
Package scraper allows to define pull based receivers that can be configured using the scraperreceiver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateLogsFunc ¶ added in v0.119.0
CreateLogsFunc is the equivalent of Factory.CreateLogs().
type CreateMetricsFunc ¶
CreateMetricsFunc is the equivalent of Factory.CreateMetrics().
type Factory ¶
type Factory interface {
component.Factory
// CreateLogs creates a Logs scraper based on this config.
// If the scraper type does not support logs,
// this function returns the error [pipeline.ErrSignalNotSupported].
CreateLogs(ctx context.Context, set Settings, cfg component.Config) (Logs, error)
// CreateMetrics creates a Metrics scraper based on this config.
// If the scraper type does not support metrics,
// this function returns the error [pipeline.ErrSignalNotSupported].
CreateMetrics(ctx context.Context, set Settings, cfg component.Config) (Metrics, error)
// LogsStability gets the stability level of the Logs scraper.
LogsStability() component.StabilityLevel
// MetricsStability gets the stability level of the Metrics scraper.
MetricsStability() component.StabilityLevel
// contains filtered or unexported methods
}
Factory is factory interface for scrapers.
This interface cannot be directly implemented. Implementations must use the NewFactory to implement it.
func NewFactory ¶
func NewFactory(cfgType component.Type, createDefaultConfig component.CreateDefaultConfigFunc, options ...FactoryOption) Factory
NewFactory returns a Factory.
type FactoryOption ¶
type FactoryOption interface {
// contains filtered or unexported methods
}
FactoryOption apply changes to Options.
func WithLogs ¶ added in v0.119.0
func WithLogs(createLogs CreateLogsFunc, sl component.StabilityLevel) FactoryOption
WithLogs overrides the default "error not supported" implementation for CreateLogs and the default "undefined" stability level.
func WithMetrics ¶
func WithMetrics(createMetrics CreateMetricsFunc, sl component.StabilityLevel) FactoryOption
WithMetrics overrides the default "error not supported" implementation for CreateMetrics and the default "undefined" stability level.
type Logs ¶ added in v0.116.0
type Logs interface {
component.Component
// ScrapeLogs is the base interface to indicate that how should logs be scraped.
ScrapeLogs(context.Context) (plog.Logs, error)
}
Logs is the base interface for logs scrapers.
type Metrics ¶
type Metrics interface {
component.Component
ScrapeMetrics(context.Context) (pmetric.Metrics, error)
}
Metrics is the base interface for metrics scrapers.
func NewMetrics ¶
func NewMetrics(scrape ScrapeMetricsFunc, options ...Option) (Metrics, error)
NewMetrics creates a new Metrics scraper.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option apply changes to internal options.
func WithShutdown ¶
func WithShutdown(shutdown component.ShutdownFunc) Option
WithShutdown sets the function that will be called on shutdown.
type ScrapeLogsFunc ¶ added in v0.116.0
type ScrapeLogsFunc ScrapeFunc[plog.Logs]
ScrapeLogsFunc is a helper function that is similar to Logs.ScrapeLogs.
func (ScrapeLogsFunc) ScrapeLogs ¶ added in v0.116.0
type ScrapeMetricsFunc ¶
type ScrapeMetricsFunc ScrapeFunc[pmetric.Metrics]
ScrapeMetricsFunc is a helper function that is similar to Metrics.ScrapeMetrics.
func (ScrapeMetricsFunc) ScrapeMetrics ¶
type Settings ¶
type Settings struct {
// ID returns the ID of the component that will be created.
ID component.ID
component.TelemetrySettings
// BuildInfo can be used by components for informational purposes.
BuildInfo component.BuildInfo
// contains filtered or unexported fields
}
Settings configures scraper creators.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package scrapererror provides custom error types for scrapers.
|
Package scrapererror provides custom error types for scrapers. |
|
scraperhelper
module
|
|
|
xscraperhelper
module
|
|
|
scrapertest
module
|
|
|
xscraper
module
|