Back to godoc.org

Package internal

v0.8.0
Latest Go to latest
Published: today | License: Apache-2.0 | Module: go.opentelemetry.io/collector

Index

Package Files

func AssertContainsAttribute

func AssertContainsAttribute(t *testing.T, attr pdata.AttributeMap, key string)

func AssertDescriptorEqual

func AssertDescriptorEqual(t *testing.T, expected pdata.MetricDescriptor, actual pdata.MetricDescriptor)

func AssertDoubleMetricLabelExists

func AssertDoubleMetricLabelExists(t *testing.T, metric pdata.Metric, index int, labelName string)

func AssertDoubleMetricLabelHasValue

func AssertDoubleMetricLabelHasValue(t *testing.T, metric pdata.Metric, index int, labelName string, expectedVal string)

func AssertDoubleMetricStartTimeEquals

func AssertDoubleMetricStartTimeEquals(t *testing.T, metric pdata.Metric, startTime pdata.TimestampUnixNano)

func AssertInt64MetricLabelExists

func AssertInt64MetricLabelExists(t *testing.T, metric pdata.Metric, index int, labelName string)

func AssertInt64MetricLabelHasValue

func AssertInt64MetricLabelHasValue(t *testing.T, metric pdata.Metric, index int, labelName string, expectedVal string)

func AssertInt64MetricStartTimeEquals

func AssertInt64MetricStartTimeEquals(t *testing.T, metric pdata.Metric, startTime pdata.TimestampUnixNano)

func AssertSameTimeStampForAllMetrics

func AssertSameTimeStampForAllMetrics(t *testing.T, metrics pdata.MetricSlice)

func AssertSameTimeStampForMetrics

func AssertSameTimeStampForMetrics(t *testing.T, metrics pdata.MetricSlice, startIdx, endIdx int)

func InitializeMetricSlice

func InitializeMetricSlice(metricData data.MetricData) pdata.MetricSlice

Initializes a metric with a metric slice and returns it.

func TimeToUnixNano

func TimeToUnixNano(t time.Time) pdata.TimestampUnixNano

type BaseFactory

type BaseFactory interface {
	// CreateDefaultConfig creates the default configuration for the Scraper.
	CreateDefaultConfig() Config
}

BaseFactory for creating Scrapers.

type BaseScraper

type BaseScraper interface {
	// 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
}

BaseScraper gathers metrics from the host machine.

type Config

type Config interface {
}

Config is the configuration of a scraper.

type ConfigSettings

type ConfigSettings struct {
}

ConfigSettings provides common settings for scraper configuration.

type ResourceScraper

type ResourceScraper interface {
	BaseScraper

	// ScrapeMetrics returns relevant scraped metrics per resource.
	// If errors occur scraping some metrics, an error should be
	// returned, but any metrics that were successfully scraped
	// should still be returned.
	ScrapeMetrics(ctx context.Context) (pdata.ResourceMetricsSlice, error)
}

ResourceScraper gathers metrics from a low-level resource such as a process.

type ResourceScraperFactory

type ResourceScraperFactory interface {
	BaseFactory

	// CreateMetricsScraper creates a resource scraper based on this
	// config. If the config is not valid, error will be returned instead.
	CreateMetricsScraper(ctx context.Context, logger *zap.Logger, cfg Config) (ResourceScraper, error)
}

ResourceScraperFactory can create a ResourceScraper.

type Scraper

type Scraper interface {
	BaseScraper

	// ScrapeMetrics returns relevant scraped metrics. If errors occur
	// scraping some metrics, an error should be returned, but any
	// metrics that were successfully scraped should still be returned.
	ScrapeMetrics(ctx context.Context) (pdata.MetricSlice, error)
}

Scraper gathers metrics from the host machine.

type ScraperFactory

type ScraperFactory interface {
	BaseFactory

	// CreateMetricsScraper creates a scraper based on this config.
	// If the config is not valid, error will be returned instead.
	CreateMetricsScraper(ctx context.Context, logger *zap.Logger, cfg Config) (Scraper, error)
}

ScraperFactory can create a MetricScraper.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier