xscraper

package module
v0.160.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package xscraper 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 CreateProfilesFunc

type CreateProfilesFunc func(context.Context, scraper.Settings, component.Config) (Profiles, error)

CreateProfilesFunc is the equivalent of Factory.CreateProfiles().

type Factory

type Factory interface {
	scraper.Factory

	// CreateProfiles creates a Profiles scraper based on this config.
	// If the scraper type does not support profiles,
	// this function returns the error [pipeline.ErrSignalNotSupported].
	CreateProfiles(ctx context.Context, set scraper.Settings, cfg component.Config) (Profiles, error)

	// ProfilesStability gets the stability level of the Profiles scraper.
	ProfilesStability() component.StabilityLevel
}

func NewFactory

func NewFactory(cfgType component.Type, createDefaultConfig component.CreateDefaultConfigFunc, options ...FactoryOption) Factory

NewFactory creates a Factory with experimental capabilities and wraps a scraper.Factory.

type FactoryOption

type FactoryOption interface {
	// contains filtered or unexported methods
}

FactoryOption apply changes to Options.

func WithLogs

WithLogs overrides the default "error not supported" implementation for CreateLogs and the default "undefined" stability level.

func WithMetrics

func WithMetrics(createMetrics scraper.CreateMetricsFunc, sl component.StabilityLevel) FactoryOption

WithMetrics overrides the default "error not supported" implementation for CreateMetrics and the default "undefined" stability level.

func WithProfiles

func WithProfiles(createProfiles CreateProfilesFunc, sl component.StabilityLevel) FactoryOption

WithProfiles overrides the default "error not supported" implementation for CreateProfiles and the default "undefined" stability level.

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.

func WithStart

func WithStart(start component.StartFunc) Option

WithStart sets the function that will be called on startup.

type Profiles

type Profiles interface {
	component.Component

	// ScrapeProfiles is the base interface to indicate that how should profiles be scraped.
	ScrapeProfiles(context.Context) (pprofile.Profiles, error)
}

Profiles is the base interface for profiles scrapers.

func NewProfiles

func NewProfiles(scrape ScrapeProfilesFunc, options ...Option) (Profiles, error)

NewProfiles creates a new Profiles scraper.

type ScrapeFunc

type ScrapeFunc[T any] func(context.Context) (T, error)

ScrapeFunc scrapes data.

type ScrapeProfilesFunc

type ScrapeProfilesFunc scraper.ScrapeFunc[pprofile.Profiles]

ScrapeProfilesFunc is a helper function.

func (ScrapeProfilesFunc) ScrapeProfiles

func (sf ScrapeProfilesFunc) ScrapeProfiles(ctx context.Context) (pprofile.Profiles, error)

Jump to

Keyboard shortcuts

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