job

package
v0.44.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureLabelConsistencyForMetrics

func EnsureLabelConsistencyForMetrics(metrics []*promutil.PrometheusMetric, observedMetricLabels map[string]model.LabelSet) []*promutil.PrometheusMetric

EnsureLabelConsistencyForMetrics ensures that every metric has the same set of labels based on the data in observedMetricLabels. Prometheus requires that all metrics with the same name have the same set of labels

func MigrateCloudwatchToPrometheus

func MigrateCloudwatchToPrometheus(cwd []*cloudwatchData, labelsSnakeCase bool, observedMetricLabels map[string]model.LabelSet, logger logger.Logger) ([]*promutil.PrometheusMetric, map[string]model.LabelSet, error)

func ScrapeAwsData

func ScrapeAwsData(
	ctx context.Context,
	cfg config.ScrapeConf,
	metricsPerQuery int,
	cloudwatchSemaphore,
	tagSemaphore chan struct{},
	cache session.SessionCache,
	logger logger.Logger,
) ([]*services.TaggedResource, []*cloudwatchData)

Types

type Clock

type Clock interface {
	Now() time.Time
}

Clock small interface which allows for stubbing the time.Now() function for unit testing

type TimeClock

type TimeClock struct{}

TimeClock implementation of Clock interface which delegates to Go's Time package

func (TimeClock) Now

func (tc TimeClock) Now() time.Time

Jump to

Keyboard shortcuts

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