scraperhelper

package module
v0.150.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: Apache-2.0 Imports: 17 Imported by: 104

README

General Information

A scraper defines how to connect and scrape telemetry data from an external source.

Status
Stability beta: metrics, logs
Issues Open issues Closed issues

Documentation

Overview

Package scraperhelper provides utilities for scrapers.

Index

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.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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